public class TestBox { public static void main(String[] args) { Box b1 = new PlasticBox(); System.out.println("The size of a new PlasticBox (of Strings) is: " + b1.size()); b1.insert("Hello there"); System.out.println("After inserting one string, size is: " + b1.size()); System.out.println("RemoveAny returned: " + b1.removeAny()); Box b2 = new PlasticBox(); System.out.println("The size of a new PlasticBox (of SafePencils) is: " + b2.size()); b2.insert(new LeadedPencil(Colors.BLACK, 7)); System.out.println("After inserting one LeadedPencil, size is: " + b2.size()); Pencil p = b2.removeAny(); System.out.println("RemoveAny returned: " + p.toString()); //the following is a compile-time error: //Box[] BA = new PlasticBox[4]; //use the wildcard ? instead Box[] BA = new PlasticBox[10]; BA[0] = new PlasticBox(); System.out.println(BA[0].size()); } }