-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
45 lines (38 loc) · 746 Bytes
/
Player.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
import java.io.*;
import java.util.*;
/**
* Beschreiben Sie hier die Klasse Player.
*
* @author Götz und Dominik
* @version 9.11
*/
public class Player
{
private int score;
public String name;
/**
* Konstruktor für Objekte der Klasse Player
*/
public Player()
{
score = 0;
this.set_name();
}
public int get_score()
{
return this.score;
}
public void add_score(int x)
{
this.score = this.score + x;
}
public String get_name()
{
return this.name;
}
public void set_name()
{
Out.println("Bitte geben Sie ihren Namen ein: ");
name = In.readWord();
}
}