-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
38 lines (35 loc) · 1.28 KB
/
Employee.java
File metadata and controls
38 lines (35 loc) · 1.28 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
34
35
36
37
38
package module2.oop.inheritance;
/**
* Employee
*/
public class Employee extends Person {
private String office;
private String salary;
private MyDate dateHired;
/**
* Construct a new Employee
*
* @param name The person's name (ex: "Nick Coolkid")
* @param address The person's address (ex: "420 Wicked Lane")
* @param phoneNumber The person's phone number (ex: "123-456-7890")
* @param emailAddress The person's email address (ex: "coolkid69@email.com")
* @param office The location of the employee's office
* @param salary The employee's yearly salary (ex: "$9999")
* @param dateHired The date the employee was hired (ex: new MyDate(2000, 01, 01))
*/
public Employee(String name, String address, String phone, String email,
String office, String salary, MyDate dateHired) {
super(name, address, phone, email);
this.office = office;
this.salary = salary;
this.dateHired = dateHired;
}
public String toString() {
return (
super.toString() + "\n"
+ "📅 Hire Date: " + dateHired.toString() + "\n"
+ "💵 Salary: " + salary + "\n"
+ "💼 Office: " + office
);
}
}