String ---> int
1 //方式一:Integer(String s) 2 //demo: 3 Integer i = new Integer("10"); // 10 4 int a = i.intValue() 5 6 //方式二:static int parseInt(String s) 7 int b = Integer.parseInt("20"); //20
int ---> String
1 //demo: 2 int a = 50; 3 String s = a + "";
原文地址:https://www.cnblogs.com/smartisn/p/11698387.html
时间: 2024-10-04 01:42:12