PRACTICE / UNDERSTAND / REPEAT

Java practice question

Practice arrays with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

1 questionAnswers explainedFree · no login

Try this question

Arrays · MCQQuestion link ↗

What value is stored in the last array element?

int[] values = new int[3];
System.out.println(values[2]);
Choose one answer
Answer & explanation

Answer: 0

Elements of a newly allocated int array have the default value zero.