Question 6
Consider the code given below.
public class SwitchTest { public static void main(String[] args) { int arr[] = {1, 2, 3}; int count = 0; for (int i : arr) { switch (i) { case 2: count += 1; case 1: count += 2; default: count += 3; } } System.out.println(count); }}What will the output be?
0
3
14
6