為了避免錯誤,最好是用 try catch 包一下來處理。 String s = "a"; int i = 0; try { i = Integer.parseInt(s); } catch (NumberFormatException e) ...
確定! 回上一頁