← Quiz: Java Arrays: all 10 questions
Quiz: Java Arrays · Question 9 of 10
What does each element of new String[3] hold before you assign anything?
What does each element of new String[3] hold before you assign anything?
- A.An empty string ""
- B.null
- C."0"
- D.It is a compile error to read them
Answer & explanation
Correct answer: null
Arrays of objects start with null in every slot; number arrays start with 0 and boolean arrays with false.
Can you get the rest right without peeking?
Take the timed Quiz: Java Arrays quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →