Hello Good afternoon, I went because I have a question if you could help me.
I want to create a ArrayList
of a class, have a dynamic array of objects of a class, I'm doing it in the following way:
ArrayList<Persona> pruebas = new ArrayList();
pruebas.set(0, new Persona());
System.out.println(pruebas.get(0).getNombre());
but it throws me an execution error:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Can you help me please.