StringIndexOutOfBoundsException
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Length: 13 0th Character: HException in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 14 kodingwindow@kw:~$
Java program to handle the StringIndexOutOfBoundsException
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Length: 13 0th Character: H Requested character not found kodingwindow@kw:~$
What Next?
Java program to handle the ArrayIndexOutOfBoundsException
Java program to handle the NegativeArraySizeException
Java program to handle the OutOfMemoryError exception
Advertisement