Java String转换为int

String转换为int型
//convert str(String) to i(int)
String str;
int i = Integer.parseInt(str);



int型转换为String
//conver i(int) to str(String)
int i;
String str = i.toString();




//convert i(int) to j(Integer)
int i;
Integer j = Integer.valueOf(i);

//convert t(Integer) to n (int)
Integer t;
int n = t.intValue();

猜你喜欢

转载自blog.csdn.net/player26/article/details/3346936