NullPointerException
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KWException in thread "main" java.lang.NullPointerException at KW.main(KW.java:6) kodingwindow@kw:~$
Java program to handle the NullPointerException
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW String is null, hence, Unable to find the length. kodingwindow@kw:~$
What Next?
Java program to handle the StringIndexOutOfBoundsException
Java program to handle the ArrayIndexOutOfBoundsException
Java program to handle the NegativeArraySizeException
Advertisement