Check out example codes for "crear objetos automaticamente java". It will help you in understanding the concepts better.

Code Example 1

public ArrayList crearColegio(int numeroAlumnos ) {
ArrayList al = new ArrayList();

for ( int i=0; i < numeroAlumnos; i++) {
Alumno alumno = new Alumno();
al.add( alumno );
}
return al;
}

Learn ReactJs, React Native from akashmittal.com