What is an array?

In Java, an array is a collection of the same type of values stored as a single variable. For example, {10, 20, 30} is an array of integers. It can be stored as a variable as shown in the code below:

Get hands-on with 1200+ tech skills courses.