-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMechanic.java
More file actions
42 lines (34 loc) · 1.11 KB
/
Mechanic.java
File metadata and controls
42 lines (34 loc) · 1.11 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
39
40
41
42
public class Mechanic extends Employee {
private String specialty;
private int experienceYears;
private boolean certified;
public Mechanic(String name, double salary, String specialty, int experienceYears, boolean certified) {
super(name, salary);
this.specialty = specialty;
this.experienceYears = experienceYears;
this.certified = certified;
}
public String getSpecialty() {
return specialty;
}
public void setSpecialty(String specialty) {
this.specialty = specialty;
}
public int getExperienceYears() {
return experienceYears;
}
public void setExperienceYears(int experienceYears) {
this.experienceYears = experienceYears;
}
public boolean isCertified() {
return certified;
}
public void setCertified(boolean certified) {
this.certified = certified;
}
@Override
public String toString() {
return super.toString() + " [Specialty: " + specialty + ", Experience: "
+ experienceYears + " yrs, Certified: " + certified + "]";
}
}