Inheritance activity

Use the code from the Inheritance Completion Activity. Create a toString() method on the superclass and the subclasses. All the relevant information about an object shall be returned if you use the object's toString() method.

Once you create the method and the two overrides, wrap the classes in application. Your application will allows the user to input any number of either books or a pieces of software. It's the user's choice. Your application will output the information about the books and software in a list. This list should not show until after the user is done entering items.

BONUS: To keep things interesting, the toString() method on the superclass should take no parameters. The toString() method on each subclass should take a detail parameter (String). If detail is set to "simple", the method should return the same thing that the superclass method would return. If it is set to "detail" the method should return all the attributes included in the subclass.

results matching ""

    No results matching ""