JAVA Flow Control What will be the output?public class Test{ public static void main(String args[]){ int i = 1; do{ i--; }while(i > 2); System.out.println(i); }} 0 1 2 -1 None of these 0 1 2 -1 None of these 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; } }} 2 3 0 1 1 2 2 3 0 1 1 2 ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control What will be the value of y after execution of switch statement?public class Test{ public static void main(String[] args){ int x = 3, y = 4; switch(x + 3){ case 6: y = 0; case 7: y = 1; default: y += 1; } }} 0 4 3 2 1 0 4 3 2 1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control Consider the following program written in Java.class Test{ public static void main(String args[]){ int x=7; if(x==2); // Note the semicolon System.out.println("NumberSeven"); System.out.println("NotSeven"); }}What would the output of the program be? Error 7 NotSeven NumberSeven NumberSeven NotSeven Error 7 NotSeven NumberSeven NumberSeven NotSeven ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control In java, ............ can only test for equality, where as .......... can evaluate any type of the Boolean expression. switch, if continue, if if, switch if, break switch, if continue, if if, switch if, break ANSWER DOWNLOAD EXAMIANS APP
JAVA Flow Control Which of the following for loops will be an infinite loop? for(i=0; ; i++) for(i=0 ; i<1; i--) All of these for(; ;) for(i=0; ; i++) for(i=0 ; i<1; i--) All of these for(; ;) ANSWER DOWNLOAD EXAMIANS APP