📜  如何检查java代码示例中的数字格式异常

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

代码示例1
try {
    int i = Integer.parseInt(s);
    // s is a valid integer
}
catch (NumberFormatException e) {
    // s is not a valid integer
}