-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
33 lines (26 loc) · 1.08 KB
/
Copy pathEmployee.java
File metadata and controls
33 lines (26 loc) · 1.08 KB
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
import java.util.Date;
public class Employee extends Person {
private int employeeNumber;
protected String empType;
// Constructor
public Employee(int employeeNumber, String name, String address, Date dateOfBirth, String email, String socialSecurityNumber,
String empType) {
super(name, address, dateOfBirth, email, socialSecurityNumber);
this.employeeNumber = employeeNumber;
this.empType = empType;
}
// Getter and Setter for employeeNumber
public int getEmployeeNumber() {
return employeeNumber;
}
public void setEmployeeNumber(int employeeNumber) {
this.employeeNumber = employeeNumber;
}
public String getEmpType() {
return this.empType;
}
//make into string to be used with SaveToFile.java
public String toString() {
return String.format("%2d\t%s\t%s\t%s\t%s\t%s\t%s\t\n", this.getEmployeeNumber(), this.getName(), this.getAddress(), this.getDateOfBirth(), this.getEmail(), this.getSocialSecurityNumber(), this.getEmpType());
}
}