-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriver.java
More file actions
39 lines (31 loc) · 745 Bytes
/
Driver.java
File metadata and controls
39 lines (31 loc) · 745 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
package main;
public class Driver {
private String name;
private String country;
private int points;
private RallyCar car;
public Driver(String name, String country, RallyCar car) {
this.name = name;
this.country = country;
this.car = car;
this.points = 0;
}
public String getName() {
return name;
}
public String getCountry() {
return country;
}
public int getPoints() {
return points;
}
public RallyCar getCar() {
return car;
}
public void setCar(RallyCar car) {
this.car = car;
}
public void addPoints(int points) {
this.points += points;
}
}