NullPointerException:空指針異常
ClassCastException:類型轉換異常
IndexOutOfBoundException:數組越界異常
ArithmaticExceptin:算術異常 //如int a=8/0
IIIelArgumentException:參數異常 //傳入了一個不合法或不正確的參數
ClassNotFoundException:找不到類異常
其他詳見:所有常見的異常
NullPointerException:空指針異常
ClassCastException:類型轉換異常
IndexOutOfBoundException:數組越界異常
ArithmaticExceptin:算術異常 //如int a=8/0
IIIelArgumentException:參數異常 //傳入了一個不合法或不正確的參數
ClassNotFoundException:找不到類異常
其他詳見:所有常見的異常
下面是我在LeetCode中看到的題目,然後自己寫的解決方法 /** * Z字型變化 * 原字符串“LEETCODEISHIRING” * after-> * L C I