6. 

Which cause a compiler error?

A. int[ ] scores = {3, 5, 7};
B. int [ ][ ] scores = {2,7,6}, {9,3,45};
C. String cats[ ] = {"Fluffy", "Spot", "Zeus"};
D. boolean results[ ] = new boolean [] {true, false, true};

7. 

Which three are valid method signatures in an interface?

  1. private int getArea();
  2. public float getVol(float x);
  3. public void main(String [] args);
  4. public static void main(String [] args);
  5. boolean setFlag(Boolean [] test);

A. 1 and 2
B. 2, 3 and 5
C. 3, 4, and 5
D. 2 and 4

8. 

You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?

A. public
B. private
C. protected
D. default access

9. 

Which one creates an instance of an array?

A. int[ ] ia = new int[15];
B. float fa = new float[20];
C. char[ ] ca = "Some String";
D. int ia[ ] [ ] = { 4, 5, 6 }, { 1,2,3 };

10. 

Which two of the following are legal declarations for nonnested classes and interfaces?

  1. final abstract class Test {}
  2. public static interface Test {}
  3. final public class Test {}
  4. protected abstract class Test {}
  5. protected interface Test {}
  6. abstract public class Test {}

A. 1 and 4
B. 2 and 5
C. 3 and 6
D. 4 and 6