Arrays of Objects in Java
An array of objects is created like an array of primitive-type data items in the following way.
Student[] arr = new Student[5]; //student is a user-defined class
Syntax:
-- data type[] arrName;
-- datatype arrName[];
-- datatype [] arrName;
Arrays in Java
In Java, Array is a group of like-typed variables referred to by a common name. Arrays in Java work differently than they do in C/C++. Following are some important points about Java arrays.