-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar.java
More file actions
36 lines (27 loc) · 743 Bytes
/
Copy pathCar.java
File metadata and controls
36 lines (27 loc) · 743 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
public abstract class Car {
protected String vinNumber;
protected String make;
protected String model;
protected int mileage;
public Car(String vinNumber, String make, String model, int mileage) {
this.vinNumber = vinNumber;
this.make = make;
this.model = model;
this.mileage = mileage;
}
public String getVinNumber() {
return vinNumber;
}
public String getMake() {
return make;
}
public String getModel() {
return model;
}
public int getMileage() {
return mileage;
}
public String getInfo() {
return String.format("VIN: %s, Make: %s, Model: %s, Mileage: %d", vinNumber, make, model, mileage);
}
}