JAVA Flow Control What will be the output?public class Test{ public static void main(String[] args){ int x=10, y=0; if(x && y){ System.out.print("TRUE"); } else{ System.out.print("FALSE"); } }} TRUE Runtime Error Compilation Error FALSE TRUE Runtime Error Compilation Error FALSE 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; } }} 2 3 0 4 1 2 3 0 4 1 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 continue, if switch, if if, switch if, break continue, if switch, if if, switch 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? NumberSeven 7 NumberSeven NotSeven NotSeven Error NumberSeven 7 NumberSeven NotSeven NotSeven Error ANSWER DOWNLOAD EXAMIANS APP
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); }} 2 -1 None of these 0 1 2 -1 None of these 0 1 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 2 1 2 3 1 0 2 1 2 3 1 ANSWER DOWNLOAD EXAMIANS APP