Multiple Choice Question

Quiz Guidelines



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
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!!!