1 Public classConverto2 3{ Public Static voidmain (String [] args)4{String Numberin =args[0];5 Convertnum (Numberin);6 }7 Static voidconvertnum (String num)8 {9 LongShownumber;Ten String temp; One Switch(num) A{ Case"One": - temp = "1"; -Shownumber = Long.parselong (temp); theSystem.out.println (num+ "Convert to" +shownumber); - Break; - Case"Both": -temp = "2"; +Shownumber =Long.parselong (temp); -System.out.println (num+ "Convert to" +shownumber); + Break; A Case"Three": attemp = "3"; -Shownumber =Long.parselong (temp); -System.out.println (num+ "Convert to" +shownumber); - Break; - Case"Four": -temp = "4"; inShownumber =Long.parselong (temp); -System.out.println (num+ "Convert to" +shownumber); to Break; + Case"Five": -temp = "5"; theShownumber =Long.parselong (temp); *System.out.println (num+ "Convert to" +shownumber); $ Break;Panax Notoginseng Case"Six": -temp = "6"; theShownumber =Long.parselong (temp); +System.out.println (num+ "Convert to" +shownumber); A Break; the Case"Seven": +temp = "7"; -Shownumber =Long.parselong (temp); $System.out.println (num+ "Convert to" +shownumber); $ Break; - Case"Eight": -temp = "8"; theShownumber =Long.parselong (temp); -System.out.println (num+ "Convert to" +shownumber);Wuyi Break; the Case"Nine": -temp = "9"; WuShownumber =Long.parselong (temp); -System.out.println (num+ "Convert to" +shownumber); About Break; $ Case"Ten": -temp = "10"; -Shownumber =Long.parselong (temp); -System.out.println (num+ "Convert to" +shownumber); A Break; + the } - $ } the the}
Long.parselong (string s) where s must be a string in the form of a number in order to use the function to convert to a long integer.
Long.parselong (string s) where s must be a string in the form of a number in order to use the function to convert to a long integer.