For input string: "", For input string: "374298744750866432"

    public static void main(String[] args) {
        System.out.println(Integer.parseInt(""));
    }

在這裏插入圖片描述
在這裏插入圖片描述

當通過Integer.parseInt()方法將字符串轉爲Integer類型時,如果字符串是空串,或者需要轉換的字符串大小已經超過了int大小時候,就會報 For input string:xxx

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章