class Dog(){ eat(); } ArrayList<Object> myArrayList = new ArrayList<Object>(); Dog aDog = new Dog(); myArrayList.add(aDog); object d = myArrayList.get(0); (Dog)d.eat();
class Dog(){ eat(); } ArrayList<Object> myArrayList = new ArrayList<Object>(); Dog aDog = new Dog(); myArrayList.add(aDog); object d = myArrayList.get(0); (Dog)d.eat();