Multiple Choice Question

Quiz Guidelines

 

QID: 
464
Question: 

What will the following program print when run without any command line argument?

public class TestClass {
    public static void main(String[] args)  {
        boolean hasParams = (args == null ? false : true);
        if(hasParams){
            System.out.println("has params");
        }{
            System.out.println("no params");
        }
    }
}

Select 1 option

A. has params
B. has params
no params
C. no params
D. It will not compile.

Q&A Set: