标题布尔类型不能和数据类型相互转换
数值类型之间可以相互转换
String转数值
public class Text{
public static void main(String[] args){
Sring s = "12345";
int x = Integer.parseInt(s);
long y = Long.parseLong(s);
double z = Double.parseDouble(s);
}
}
数值转String
public class Text{
public static void main(String[] args){
int x = 10;
String s = "" + x;
String s = String.valueOf(s);
}
}