-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScoreboard.java
More file actions
47 lines (35 loc) · 799 Bytes
/
Copy pathScoreboard.java
File metadata and controls
47 lines (35 loc) · 799 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
package com.javaex.api.objectclass.ex04;
public class Scoreboard implements Cloneable {
private int scores[];
// 생성자
public Scoreboard(int[] scores) {
this.scores = scores;
}
public Scoreboard getClone() {
Scoreboard clone = null;
try {
clone = (Scoreboard)clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return clone;
}
@Override
public String toString() {
String output = "Scoreboard(";
for(int i = 0; i < scores.length; i++) {
output += scores[i];
if (i < scores.length - 1) {
output += ",";
}
}
output += ")";
return output;
}
public int[] getScores() {
return scores;
}
public void setScores(int[] scores) {
this.scores = scores;
}
}