Chapter 4Creating and Using Arrays

THE OCA EXAM TOPICS COVERED IN THIS PRACTICE TEST INCLUDE THE FOLLOWING:

  • Creating and Using Arrays
    • Declare, instantiate, initialize and use a one-dimensional array
    • Declare, instantiate, initialize and use multi-dimensional arrays
  1. What symbol is used for a varargs method parameter?

    1. ..
    2. ...
    3. --
    4. ---
  2. Fill in the blank in the following code to get the first element from the varargs parameter.

    public void toss (Frisbee... f) {
       Frisbee first = ____________;
    }
    1. f
    2. f[0]
    3. f[1]
    4. None of the above
  3. Which of the following are primitives?

    int[] lowercase = new int[0];
    Integer[] uppercase = new Integer[0]; ...

Get OCA / OCP Java SE 8 Programmer Practice Tests now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.