int t1 = 2;
String t2 = Integer.toString(t1);

2、字符串转换为基本数据类型

int t3 = Integer.parseInt(t2);
double t4 = Double.parseDouble(t2);
....
int t5 = Integer.valueOf(t2)

 

相关文章: