-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmp.java
More file actions
49 lines (43 loc) · 1.08 KB
/
Copy pathEmp.java
File metadata and controls
49 lines (43 loc) · 1.08 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
43
44
45
46
47
48
49
package 자바0929;
public class Emp{
//필드변수
private int 사원번호;
private String 사원이름;
private int 급여;
private int 보너스;
//생성자(리턴 타입이 없는 메소드)
Emp(){
}
Emp(int 사원번호, String 사원이름, int 급여, int 보너스){
//파라미터로 받아온 값을 필드변수에 대입하겠다.
this.사원번호 = 사원번호;
this.사원이름 = 사원이름;
this.급여 = 급여;
this.보너스 = 보너스;
}
//메소드(함수)
public int get사원번호() {
return 사원번호;
}
public void set사원번호(int 사원번호) {
this.사원번호 = 사원번호;
}
public String get사원이름() {
return 사원이름;
}
public void set사원이름(String 사원이름) {
this.사원이름 = 사원이름;
}
public int get급여() {
return 급여;
}
public void set급여(int 급여) {
this.급여 = 급여;
}
public int get보너스() {
return 보너스;
}
public void set보너스(int 보너스) {
this.보너스 = 보너스;
}
}