int 转为String
方式1
int number = 100;
String s1 = "" + number;
System.out.println(s1);
//方式2
int number = 100;
String s2 = String.valueOf(number);
System.out.println(s2);
String 转 int
方式1(把String转为Integer在转为int)
String s = "100";
Integer i1 = Integer.valueOf(s);
i1 = i1.intValue();
System.out.println(i1);
方式2(把String直接转为int)
String s = "100";
int i2 =Integer.parseInt(s);
System.out.println(i2);