Multiple Choice Question

Quiz Guidelines

 

QID: 
462
Question: 

What will the following code print when run?

public class TestClass {
    public static void main(String[] args) throws Exception {
         boolean flag  = true;
         switch (flag){
             case true : System.out.println("true");
                 default: System.out.println("false");
         }
              
    }
}

Select 1 option

A. It will not compile.
B. false
C. true
     False
D. Exception at run time.

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!