Multiple choice technology databases

What is the base type of the array given below? Color[] example = new Color[20];

  1. Color

  2. example

  3. No base type

  4. Both (A) and (B)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In the array declaration Color[] example = new Color[20], Color is the base type (component type) of the array. The variable name is example, but the array's base type - the type of elements it stores - is Color. Every array in Java has a base type that specifies what kind of objects it can hold.