-
Notifications
You must be signed in to change notification settings - Fork 1
/
Staff.java
48 lines (28 loc) · 917 Bytes
/
Staff.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.time.LocalDate;
import java.util.Date;
public abstract class Staff extends Person{
private double salary;
public String designation;
public Staff(String fn, String ln, LocalDate dob, String email, LocalDate startDate, LocalDate endDate, double salary, String designation) {
super(fn, ln, dob, email, startDate, endDate);
this.salary = salary;
this.designation = designation;
}
public double getSalary() {
return salary;
}
// public abstract double calculateSalary() ;
public void setSalary(double salary) {
this.salary = salary;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
@Override
public String toString() {
return "staff profile: " + super.toString() + "salary = " + getSalary()+ ", designation = " + this.designation;
}
}