Shortcut Navigation:

Reference Types Quiz

Which two are acceptable types for x? switch(x){default:System.out.println("Hello");}  
  1. byte
  2. long
  3. char
  4. float
  5. Short
  6. Long

Which statement is true? 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?While public class While{public void loop(){int x= 0;while ( 1 ) /* Line 6 */{System.out.print("x plus one is " + (x + 1)); /* Line 8 */}}}