Returning an object type from an arraylist

Not sure if this might help, but whilst n arraylist needs to have a type, you can make an arraylist of arraylist, then technically the parent arraylist holds multiple types. Then i suppose that you could keep track of the type with a hashmap which would take the position of the parent arraylist and a string.

This would require you to update the hashmap everytime you add a new item to the parent arraylist.

I think you could grab a string of the class by using reflections

Ie object.class, but i dont completely understand reflections yet.