🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.An empty string ""
  2. B.null
  3. C."0"
  4. 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 →