Exercise 3.10
- public class Employee
- {
- private double monthlySalary=0.0f;
- {
- this.firstName=firstName;
- this.lastName=lastName;
- this.monthlySalary=monthlySalary;
- }
- public double getmonthlySalary()
- {
- if (monthlySalary<0)
- {
- return 0.0f;
- }
- else
- {
- return monthlySalary;
- }
- }
- {
- return lastName;
- }
- {
- return firstName;
- }
- }
- /* Another class*/
- public class EmployeeTest
- {
- {
- Employee Justin=new Employee("Chan","Siu Ming",8000.0);
- Employee Hoyin=new Employee("Chan","Tai Ming",10000.0);
- }
- }