Multiple Choice Question

Quiz Guidelines

 

QID: 
149
Question: 

Consider the following method...

public void ifTest(boolean flag){
if (flag) //1
if (flag) //2
System.out.println("True False");
else // 3
System.out.println("True True");
else // 4
System.out.println("False False");
}

Which of the following statements are correct?

Select 3 options

A. If run with an argument of 'false', it will print 'False False'
B. If run with an argument of 'false', it will print 'True True'
C. If run with an argument of 'true', it will print 'True False'
D. It will never print 'True True'
E. It will not compile.

Q&A Set: