2017年9月7日星期四
一.八大数据类型及其封装类
byte int long short double float boolean char
Byte Intger Long Short Double Float Boolean character
二,基本数据类型转String
String a = "123";
int b = Integer.parseInt(a);
System.out.println(b);
a = "12.56546";
float c = Float.parseFloat(a);
System.out.println(c);
a = "23";
double d = Double.parseDouble(a);
System.out.println(d);
a = "56";
byte e = Byte.parseByte(a);
System.out.println(e);
a = "ture";
boolean f = Boolean.parseBoolean(a);
System.out.println(f);
a = "6565";
long g = Long.parseLong(a);
System.out.println(g);
a = "313";
short h = Short.parseShort(a);
System.out.println(a);
三.基本数据类型的转换
String str = string.valueOf();
Int = a = Integer.parseInt(str);