NullPointerException is a child class of RunTimeException, Hence it is an unchecked exception, Raised automatically by JVM, Whenever we are trying to perform any operation on null we will get this NullPointerException.

public class NullPointerException {
    public static void main(String[] args) {
        String str = null;
NullPointerException in Java

Similar Java Tutorials

Leave a Comment