Java (GATE)

Casual Mode - Take your time!

1 / 13
Correct
0
Incorrect
0
Score
0%
Multiple Choice

What is the output of the given program?

public class HelloWorld {
 public static void main(String[] args) {
  String s1 = "Welcome to Aliensbrain";
  String s2 = "Welcome to Aliensbrain";
  switch (s1 == s2) {
   default: System.out.println("Bye");
   case 1:
     System.out.println("Hello Italy");
   case 0:
     System.out.println("Hello Paris");
  }
 }
}
  1. Hello ItalyHello Paris
  2. Hello Paris
  3. Bye Hello ItalyHello Paris
  4. Compiler Error
  5. Run time exception
Change Mode