-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMember.java
More file actions
49 lines (38 loc) · 1.11 KB
/
Member.java
File metadata and controls
49 lines (38 loc) · 1.11 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 com.example.mygame;
public class Member {
private String name, password;
private long highscore;
public Member(String name, String password){
this.name = name;
this.password = password;
this.highscore = 0;
}
public Member(String name, String password, long highscore){
this.name = name;
this.password = password;
this.highscore = highscore;
}
public int Highscore2(){return ((int)highscore);}
public long getHighscore(){return highscore;}
public String getName() {
return name;
}
public String getPassword() {
return password;
}
public void setHighscore(long highscore) {
this.highscore = highscore;
}
public void setName(String name) {
this.name = name;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof Member)
return ((Member)obj).getName().equals(this.name);
return false;
}
}