(String[] args)
| 2 | |
| 3 | public class StringToNumber { |
| 4 | public static void main(String[] args){ |
| 5 | //Sting 转 double |
| 6 | String str1 = "30.1"; |
| 7 | double num1 = Double.parseDouble(str1); |
| 8 | System.out.println(num1); |
| 9 | //Sting 转 int |
| 10 | String str2 = "30"; |
| 11 | int num2 = Integer.parseInt(str1); |
| 12 | System.out.println(num1); |
| 13 | } |
| 14 | |
| 15 | |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected