I have a class - xClass, that I want to load into an array of xClass so I the declaration:
xClass mysclass[] = new xClass[10]; myclass[0] = new xClass(); my
You can do some thing
private static Person [] addPersons(Person[] persons, Person personToAdd) { int currentLenght = persons.length; Person [] personsArrayNew = Arrays.copyOf(persons, currentLenght +1); personsArrayNew[currentLenght] = personToAdd; return personsArrayNew; }