Multiple choice technology programming languages

class C { public static void main(String[] args) { int i1=1; switch(i1){ case 1: System.out.println("one"); case 2: System.out.println("two"); case 3: System.out.println("three"); }}} What is the result of attempting to compile and run the program?

  1. Prints one, two , three

  2. prints one

  3. compile time error

  4. Run time Exception

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This switch statement lacks 'break' statements, causing fall-through execution. When i1 equals 1, case 1 matches and 'one' is printed, but execution continues through case 2 (printing 'two') and case 3 (printing 'three'). This is the default switch behavior in Java - without explicit breaks, all cases after the matching case execute sequentially.