Site Search:

Flash Card List 2 -- Card 2

Prev Next


What is the output of the following code snippets?
  4 boolean tell = true;
  5 switch(tell) {
  6   case true: System.out.println("Y"); break;
  7   case false: System.out.println("N"); break;
  8 }


the code does not compile, The allowed variable types includes: byte, Byte, short, Short, int, Integer, char, Character, String, enum values.