-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
48 lines (40 loc) · 800 Bytes
/
Employee.java
File metadata and controls
48 lines (40 loc) · 800 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
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.*;
class Employee {
/**
* File 1/2 of ArrayList
* Base class of ArrayList
*/
private String name;
private int id;
private String dept;
Employee(int id,String name,String dept){
this.id=id;
this.name=name;
this.dept=dept;
}
Employee(){
}
public void detail(){
System.out.print(this.id+" ");
System.out.print(this.name+" ");
System.out.println(this.dept+" ");
}
public void setName(String n){ //setter mutator
this.name = n;
}
public String getName(){ //accessor
return this.name;
}
public void setId(int n){ //setter mutator
this.id = n;
}
public int getId(){ //accessor
return this.id;
}
public void setDept(String n){ //setter mutator
this.dept = n;
}
public String getDept(){ //accessor
return this.dept;
}
}