I\'m tring to create an arraylist of different class instances. How can I create a list without defining a class type? ()
()
List
List anyObject = new ArrayList();
or
now anyObject can hold objects of any type.
anyObject
objects of any type
use instanceof to know what kind of object it is.
what kind of object it is