1、String转Int,两种方法
String s="9527";
//方法一:
Integer i =new Integer(s);
int x=i.intValue();
System.out.println(x);
//方法二:
int y = Integer.parseInt(s);
System.out.println(y);
2、Int转String,四种方法
int num=9527;
//方法一:
String s1=""+num;
System.out.println(s1);
//方法二:
String s2 =String.valueOf(num);
System.out.println(s2);
//方法三:
Integer i =new Integer(num);
String s3 =i.toString();
System.out.println(s3);
//方法四
String s4 =Integer.toString(i);
System.out.println(s4);