Say I have 2 arrays of objects which all extend the same abstract class, and I want the second list's first element to be a new instance of the same class which the first element in the first array is (this assumes that they take the same parameters).
Animals[] animals1 = new Animals[] {new Cat(), new Dog()...}
Animals[] animals2 = new Animals[] {new animals1[0].getClass()} //doesn't work obviously
Is there a way of doing this?