-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVehicle.java
62 lines (51 loc) · 1.3 KB
/
Vehicle.java
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
57
58
59
60
61
62
public class Vehicle {
private String brand;
private String model;
private int maxSpeed;
private String driver;
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public int getMaxSpeed() {
return maxSpeed;
}
public void setMaxSpeed(int maxSpeed) {
this.maxSpeed = maxSpeed;
}
public String getDriver() {
return driver;
}
public void setDriver(String driver) {
this.driver = driver;
}
public Vehicle(String brand, String model, int maxSpeed, String driver) {
this.brand = brand;
this.model = model;
this.maxSpeed = maxSpeed;
this.driver = driver;
}
public Vehicle() {
this.brand = "Unknown";
this.model = "Unknown";
this.maxSpeed = 0;
this.driver = "Unknown";
}
@Override
public String showInfo() {
return "Vehicle{" +
"brand='" + brand + '\'' +
", model='" + model + '\'' +
", maxSpeed=" + maxSpeed +
", driver='" + driver + '\'' +
'}';
}
}