Examveda
Examveda

What is the printout of the following switch statement?
char ch = 'a';  
switch (ch){
      case 'a':
      case 'A': System.out.print(ch); break;
      case 'b':
      case 'B': System.out.print(ch); break;
      case 'c':
      case 'C': System.out.print(ch); break;
      case 'd':
      case 'D': System.out.print(ch);
}

A. abcd

B. aa

C. a

D. ab

E. abc

Answer: Option C


This Question Belongs to Java Program >> Flow Control

Join The Discussion

Comments ( 1 )

  1. Vimlesh Yadav
    Vimlesh Yadav :
    5 years ago

    switch is not case sensitive.

Related Questions on Flow Control