1.数字转字符串
int i = 5; //方法1 String str = String.valueOf(i); //方法2 Integer it = i; String str2 = it.toString();
2.字符串转数字
String str = "999"; int i= Integer.parseInt(str); System.out.println(i);
1.数字转字符串
int i = 5; //方法1 String str = String.valueOf(i); //方法2 Integer it = i; String str2 = it.toString();
2.字符串转数字
String str = "999"; int i= Integer.parseInt(str); System.out.println(i);
转载于:https://www.cnblogs.com/StingLon/p/11400846.html