Menu
Question Index
...

What will be the output of the following program?

public class Mummy
{
    static public void main(String[] b)
    {
        String a = null;
        if (a != null & a.length() > 10)
        {
            System.out.println("Merit Campus");
        }
    }
}


EMPTY
Merit Campus
Expection in thread "main" java.lang.NullPointerException
Compilation Error or Runtime Error for some other reason

Doubts

Problems

Topic: Java length() Method | length() Method In Java - Strings

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App