forked from Rapter1990/JavaStreamAPIExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeam.java
More file actions
56 lines (38 loc) · 1.09 KB
/
Team.java
File metadata and controls
56 lines (38 loc) · 1.09 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
50
51
52
53
54
55
56
package footballleagueexample;
public class Team {
private String name;
private int points;
private int goalsScored;
private int goalsAgainst;
private int goalDifference;
public Team(String name, int points, int goalsScored, int goalsAgainst) {
this.name = name;
this.points = points;
this.goalsScored = goalsScored;
this.goalsAgainst = goalsAgainst;
this.goalDifference = goalsScored - goalsAgainst;
}
public String getName() {
return name;
}
public int getPoints() {
return points;
}
public int getGoalsScored() {
return goalsScored;
}
public int getGoalsAgainst() {
return goalsAgainst;
}
public int getGoalDifference() {
return goalDifference;
}
@Override
public String toString() {
return "Club:" + this.getName() +
", GF: " + this.getGoalsScored() +
", GA: " + this.getGoalsAgainst() +
", GD: " + this.getGoalDifference()+
", Pts: " + this.getPoints() + "\n";
}
}