public static void main(String args[]) { Elephant Nellie = new Elephant("Nellie"); LinkedList<String> nellieLikes = new LinkedList<String>(); // Try adding more than apples? nellieLikes.add("apples"); // nellieLikes.add( "elephants" ); Nellie.setLikes(nellieLikes); // What happens to the 'likes' print out if nellie likes more than one thing? System.out.println(Nellie.getName() + " likes " + Nellie.getLikes().getFirst()); System.out.println( Nellie.getName() + " is an instance of " + Nellie.getClass().getSuperclass()); // This just iterates through the superclasses of Nellie, working up the inheritance tree. Class cls = Nellie.getClass(); Class oldCls = cls; while ((cls = cls.getSuperclass()) != null) { if (cls.toString().equals("class java.lang.Object")) { System.out.println("And in Java, every Object is an instance of " + cls); } else { System.out.println(oldCls + " is an instance of: " + cls); } oldCls = cls; } }