educative.io

Meaning of int []

What does the int [] mean in the exercise?


Course: https://www.educative.io/collection/6650775272947712/6368023997317120
Lesson: https://www.educative.io/collection/page/6650775272947712/6368023997317120/5119526346162176

Hi @Eric_249 !!
Thanks for contacting the Educative team. In Java, array declaration has two components: the data-type and the name, and we can put [] either with data-type or with name to specify an array such as :

data-type name[];
OR
data-type[] name;

In the exercise, int[] data means an array with data type integer and name data.
I hope it helps. Happy Learning :slight_smile:

1 Like

Thanks Javeria. The answer is super helpful!


Course: https://www.educative.io/collection/6650775272947712/6368023997317120
Lesson: https://www.educative.io/collection/page/6650775272947712/6368023997317120/5119526346162176

2 Likes