## Java 将String,int,Integer,double类型转换
1.如何将字串 String 转换成整数 int
String x="2";
int y = Integer.valueOf(x).intValue();
System.out.println(y);
String x="2";
int y=new Integer(x);
System.out.println(y);
2.如何将整数 int 转换成字串 String
int x=2;
String y=Integer.toString(x);
System.out.println(y);
int x=
原创
2020-11-21 16:55:40 ·
87 阅读 ·
0 评论