Engineering Full Stack Apps with Java and JavaScript
What will be the result of attempting to compile and run the following code?
class SwitchTest{ public static void main(String args[]){ for ( int i = 0 ; i < 3 ; i++){ boolean flag = false; switch (i){ flag = true; } if ( flag ) System.out.println( i ); } } }
Select 1 option
A. It will print 0, 1 and 2.
B. It will not print anything.
C. Compilation error.
D. Runtime error.
E. None of the above.