Lab Objectives To gain experience with programming inheritance calling superclass constructors and methods the concept of dynamic binding implementing interfaces supplying the toString , equals and clone methods in the Object class P1. For each subclass, supply private instance variables. Leave the bodies of the constructors and the print methods blank for now. Calling the Superclass constructor Implement constructors for each of the three subclasses. Each constructor needs to call the superclass constructor to set the name.
Dynamic Binding Supply the implementation of the print method for the three subclasses.
The subclass methods need to call the superclass print method to print the name of the cardholder. The addCard method checks if card1 is null . If so, it sets card1 to the new card. If not, it checks card2 . If both cards are already set, the method has no effect.