我曾尝试将我的 String 转换为 int,但我的代码一直崩溃。
String
int
代码如下:
String age = getAge(); CalculateDaysSinceBirth((int) age);
但我得到一个 NumberFormatException。
NumberFormatException
尝试使用 Integer.valueOf(age) 插入的 (int) age
Integer.valueOf(age)
(int) age