Java OCA OCP Practice Question 887

Question

How many dimensions does the array reference myField allow?

boolean[][][] bools, myField; 
  • A. One dimension
  • B. Two dimensions
  • C. Three dimensions
  • D. None of the above


C.

Note

Since the braces in the declaration are before the variable names, the variable type boolean[][][] applies to both variables.

Therefore, both bools and myField can reference a 3D array.




PreviousNext

Related