- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
Latest commit
45 lines (38 loc) · 746 Bytes
/
Copy pathPlayer.java
File metadata and controls
45 lines (38 loc) · 746 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
importjava.io.*;
importjava.util.*;
/**
* Beschreiben Sie hier die Klasse Player.
*
* @author Götz und Dominik
* @version 9.11
*/
publicclassPlayer
{
privateintscore;
publicStringname;
/**
* Konstruktor für Objekte der Klasse Player
*/
publicPlayer()
{
score = 0;
this.set_name();
}
publicintget_score()
{
returnthis.score;
}
publicvoidadd_score(intx)
{
this.score = this.score + x;
}
publicStringget_name()
{
returnthis.name;
}
publicvoidset_name()
{
Out.println("Bitte geben Sie ihren Namen ein: ");
name = In.readWord();
}
}