-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicle.java
More file actions
60 lines (49 loc) · 1.26 KB
/
Copy pathVehicle.java
File metadata and controls
60 lines (49 loc) · 1.26 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
57
58
59
60
public class Vehicle {
public String make;
public String model;
public int year;
public String color;
public String plate;
public Driver owner;
public Boolean reportedStolen=false;
public Vehicle (){
this("","",0,"","");
}
public Vehicle (String make ,String model,int year,String color,String plate){
this.make=make;
this.model=model;
this.year=year;
this.color=color;
this.plate=plate;
}
public String getMake(){
return this.make;
}
public String getModel(){
return this.model;
}
public int getYear(){
return this.year;
}
public String getColor(){
return this.color;
}
public String getPlate(){
return this.plate;
}
public Driver getOwner(){
return this.owner;
}
public boolean getReportedStolen(){
return this.reportedStolen;
}
public void setReportedStolen(Boolean reported){
this.reportedStolen=reported;
}
public void setOwner(Driver owner){
this.owner=owner;
}
public String toString(){
return "A "+getColor()+" "+ Integer.toString(getYear())+" "+getMake()+" "+getModel()+" with plate"+" "+getPlate();
}
}