📜  java.lang.NumberFormatException:对于输入字符串:“” - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:21.945000             🧑  作者: Mango

代码示例1
"N/A" is not an integer. It must throw NumberFormatException if you try to parse it to an integer.

Check before parsing or handle Exception properly.

Exception Handling

try{
    int i = Integer.parseInt(input);
} catch(NumberFormatException ex){ // handle your exception
    ...
}