从字符串转换

基本类型 / 数字 / 整型

String strNumber = "42";
int number = Integer.parseInt(strNumber);

System.out.println(number);