Shortcut Navigation:

Java Programming Language Quiz

Which four options describe the correct default values for array elements of the types indicated?  
  1. int -> 0
  2. String -> "null"
  3. Dog -> null
  4. char -> '\u0000'
  5. float -> 0.0f
  6. boolean -> true

Which one of these lists contains only Java programming language keywords?

Which will legally declare, construct, and initialize an array?

Which is a reserved word in the Java programming language?

Which is a valid keyword in java?

Which three are legal array declarations?  
  1. int [] myScores [];
  2. char [] myChars;
  3. int [6] myScores;
  4. Dog myDogs [];
  5. Dog myDogs [7];

public interface Foo { int k = 4; /* Line 3 */ }Which three piece of codes are equivalent to line 3?
  1. final int k = 4;
  2. public int k = 4;
  3. static int k = 4;
  4. abstract int k = 4;
  5. volatile int k = 4;
  6. protected int k = 4;

Which one of the following will declare an array and initialize it with five numbers?

Which three are valid declarations of a char?  
  1. char c1 = 064770;
  2. char c2 = 'face';
  3. char c3 = 0xbeef;
  4. char c4 = \u0022;
  5. char c5 = '\iface';
  6. char c6 = '\uface';

Which is the valid declarations within an interface definition?