Java Reference
In-Depth Information
Figure 3-21.
Tutorial: Generating Getters and Setters
Currently, as shown in the following Diagram 3-1 , EmployeeApp creates an Employee object and sets the one property
to “Mary Worker.” It also creates an Employee variable (emp) and assigns the object to the variable. The Employee
variable (emp) is then passed to the EmpFrame object's constructor and the text “My First Label” is displayed.
Diagram 3-1.
We want to enhance the Employee class with additional properties to hold the employee mailing address. This
means that EmployeeApp has to be modified to set values for these new properties and EmpFrame must be changed
to display the new property values. Diagram 3-2 shows the changes that we want to make.
Diagram 3-2.
 
Search WWH ::




Custom Search