topic/Flow Control
Start Test
Question No
Title
Type
Marks
737.
public void foo( boolean a, boolean b) { if( a ) { System.out.println("A"); /* Line 5 */ } else if(a && b) /* Line 7 */ { System.out.println( "A && B"); } else /* Line 11 */ { if ( !b ) { System.out.println( "notB") ; } else { System.out.println( "ELSE" ) ; } } }
MCQ
5
738.
switch(x) { default: System.out.println("Hello"); }Which two are acceptable types for x?bytelongcharfloatShortLong
MCQ
5
739.
public void test(int x) { int odd = 1; if(odd) /* Line 4 */ { System.out.println("odd"); } else { System.out.println("even"); } }Which statement is true?
MCQ
5
740.
public class While { public void loop() { int x= 0; while ( 1 ) /* Line 6 */ { System.out.print("x plus one is " + (x + 1)); /* Line 8 */ } } }Which statement is true?
MCQ
5