![]() |
Help: Using Inheritance
Help is available for each task, or you can go straight to the solution source code.
NamedEntity will have a private String variable to hold the name. The constructor takes a String argument to set the name initially. The first method, getName, will return the value of the name variable. The second method, setName, will take a String argument and set the name variable to be it. Task 2Modify the Employee class to use the new superclass.The constructor for NamedEntity should be called in Employee's constructor, and all references to Employee's name variable changed to the method getName. Task 3Modify the Company class to use the new superclass.See help for the previous task. |
Copyright © 1996-1997 MageLang Institute. All Rights Reserved. |