This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
if (o instanceof Fruit)
Fruit a (Fruit) a
I am using a java/javac version 1.6. Any idea why this is not working for my compiler ? I assume it should work because all classes inherit from Object. I thought it was referring to the wrong Object class, so I changed the method to public boolean add(java.lang.Object o), which seems to work.