juniorJava

What is an array in Java?

Updated May 6, 2026

Short answer

Array is a fixed-size container storing same-type elements.

Deep explanation

Arrays store elements in contiguous memory and accessed via index.

Real-world example

Used in storing scores, lists, and datasets.

Common mistakes

  • Accessing invalid index causing exceptions.

Follow-up questions

  • Can array size change?
  • What is ArrayIndexOutOfBounds?

More Java interview questions

View all →