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; } }
public boolean[] bbooleanArray(boolean[] a, boolean b[]) { return delegate.bbooleanArray(a, b); }
public boolean bboolean(boolean a, boolean b) { return delegate.bboolean(a, b); }
public short sshort(short a, short b) { return delegate.sshort(a, b); }
public char cchar(char a, char b) { return delegate.cchar(a, b); }
public double ddouble(double a, double b) { return delegate.ddouble(a, b); }
public float ffloat(float a, float b, float c, float d) { return delegate.ffloat(a, b, c, d); }
public byte bbyte(byte a, byte b, byte c) { return delegate.bbyte(a, b, c); }
public long llong(long a, long b) { return delegate.llong(a, b); }
public int iint(int a, int b) { return delegate.iint(a, b); }
public String[] objectsArray(String[] one, String[] two) throws IOException { return delegate.objectsArray(one, two); }
public String objects(String one, String two) throws IOException { return delegate.objects(one, two); }