forked from softwareconstruction240/softwareconstruction
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
31 lines (23 loc) · 835 Bytes
/
Employee.java
File metadata and controls
31 lines (23 loc) · 835 Bytes
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
package ConstructorExamples;
import java.util.Date;
public class Employee extends Person {
private Date hireDate;
public Employee(String firstName, String lastName) {
this(firstName, lastName, null);
}
public Employee(String firstName, String lastName, Date birthDate) {
this(firstName, lastName, birthDate, null);
}
public Employee(String firstName, String lastName, Date birthDate, Date hireDate) {
// What happens if you comment out the super call? Why?
// What happens if you comment out the this calls in the other constructors?
super(firstName, lastName, birthDate);
this.hireDate = hireDate;
}
public Date getHireDate() {
return hireDate;
}
public void setHireDate(Date hireDate) {
this.hireDate = hireDate;
}
}