forked from ChathuminaVimukthi/Object-Oriented-Programing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar.java
More file actions
38 lines (29 loc) · 726 Bytes
/
Car.java
File metadata and controls
38 lines (29 loc) · 726 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
package vehicle.park;
public class Car extends Vehicle{
private int numofDoors;
private String color;
public Car(String vehicleId, String vehicleBrand, String vehicleType, int year, int month, int date, int hours,
int numofDoors, String color) {
super(vehicleId, vehicleBrand, vehicleType, year, month, date, hours);
this.numofDoors = numofDoors;
this.color = color;
}
public int getNumofDoors() {
return numofDoors;
}
/**
*Sets the number of doors for the car
*/
public void setNumofDoors(int numofDoors) {
this.numofDoors = numofDoors;
}
public String getColor() {
return color;
}
/**
*Sets the color of the car
*/
public void setColor(String color) {
this.color = color;
}
}