← Back to Question List
Java Code Walkthrough #26
Switch Fall Through With Break
📄 Code
Read carefully — what does this print?1public class Main {2 public static void main(String[] args) {3 int x = 2;45 switch (x) {6 case 1:7 System.out.print("A");8 case 2:9 System.out.print("B");10 case 3:11 System.out.print("C");12 break;13 default:14 System.out.print("D");15 }1617 System.out.println();18 }19}