-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
36 lines (29 loc) · 811 Bytes
/
Employee.java
File metadata and controls
36 lines (29 loc) · 811 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
32
33
34
35
36
package company_EMS;
public class Employee{
private static Integer count= 1;
private String firstName;
private String lastName;
private Integer id;
private int salary;
public Employee(String firstName,String lastName, int salary){
this.firstName = firstName;
this.lastName = lastName;
this.id = count;
this.salary = salary;
count +=1;
}
public String getName(){
String fullName = this.firstName+ this.lastName;
return fullName;
}
public Integer getId(){
return this.id;
}
public void setName(String firstName, String lastName){
this.firstName= firstName;
this.lastName = lastName;
}
public void setSalary(int salary){
this.salary = salary;
}
}