-
Notifications
You must be signed in to change notification settings - Fork 1
/
Employee.java
46 lines (34 loc) · 860 Bytes
/
Employee.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
package intromethods;
public class Employee {
private String name;
private int hiringYear;
private int sallary;
public Employee(String name, int hiringYear, int sallary) {
this.name = name;
this.hiringYear = hiringYear;
this.sallary = sallary;
}
@Override
public String toString() {
return "Employee{" +
"name='" + name + '\'' +
", hiringYear=" + hiringYear +
", sallary=" + sallary +
'}';
}
public void raiseSalary(int up) {
this.sallary += up;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getHiringYear() {
return hiringYear;
}
public int getSallary() {
return sallary;
}
}