-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientInfo.java
More file actions
46 lines (37 loc) · 1.24 KB
/
ClientInfo.java
File metadata and controls
46 lines (37 loc) · 1.24 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
package WordChain;
import java.io.Serializable;
//*******************************************************************
// # 01
//*******************************************************************
// Name : ClientInfo
// Type : class
// Description : Client의 이름과 정보를 저장할 class
// Serializable을 구현하여 객체 직렬화, 역직렬화를 지원한다.
// 생성자와 내부 데이터 get, set, up 동작이 구현되어 있다.
//*******************************************************************
public class ClientInfo implements Serializable {
private String username;
private int score;
public ClientInfo(String username) {
this.username = username;
this.score = 0;
}
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return username;
}
public void setScore(int score) {
this.score = score;
}
public void upScore(int score) {
this.score += score;
}
public int getScore() {
return score;
}
public String toString() {
return "이름 : "+ username +" / 점수 : "+ score;
}
}