JAVA Flow Control What will be the result?1. int i = 10;2. while(i++ <= 10){3. i++;4. }5. System.out.print(i); 10 11 Line 5 will be never reached. 12 13 10 11 Line 5 will be never reached. 12 13 ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control What is the printout of the following switch statement?char ch = 'a'; switch (ch){ case 'a': case 'A': System.out.print(ch); break; case 'b': case 'B': System.out.print(ch); break; case 'c': case 'C': System.out.print(ch); break; case 'd': case 'D': System.out.print(ch);} abcd a aa ab abc abcd a aa ab abc ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control What all gets printed when the following program is compiled and run.public class Test{ public static void main(String args[]){ int i, j=1; i = (j>1)?2:1; switch(i){ case 0: System.out.println(0); break; case 1: System.out.println(1); case 2: System.out.println(2); break; case 3: System.out.println(3); break; } }} 0 1 2 1 2 3 0 1 2 1 2 3 ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control What will be the output of the following program?public class Test{ public static void main(String args[]){ int i = 0, j = 5 ; for( ; (i < 3) && (j++ < 10) ; i++ ){ System.out.print(" " + i + " " + j ); } System.out.print(" " + i + " " + j ); }} 0 6 1 7 2 8 3 9 Compilation Error 0 6 1 5 2 5 3 5 0 6 1 7 2 8 3 8 0 6 1 7 2 8 3 9 Compilation Error 0 6 1 5 2 5 3 5 0 6 1 7 2 8 3 8 ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control In java, ............ can only test for equality, where as .......... can evaluate any type of the Boolean expression. if, break if, switch switch, if continue, if if, break if, switch switch, if continue, if ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control Determine output:public class Test{ public static void main(String args[]){ int i; for(i = 1; i < 6; i++){ if(i > 3) continue ; } System.out.println(i); }} 6 5 2 4 3 6 5 2 4 3 ANSWER DOWNLOAD EXAMIANS APP