-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar.java
More file actions
28 lines (25 loc) · 918 Bytes
/
Car.java
File metadata and controls
28 lines (25 loc) · 918 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
public class Car {
private String carId;
private String brand;
private String model;
private double basePricePerDay;
private boolean isAvailable;
public Car(String carId, String brand, String model, double basePricePerDay, boolean isAvailable) {
this.carId = carId;
this.brand = brand;
this.model = model;
this.basePricePerDay = basePricePerDay;
this.isAvailable = isAvailable;
}
// Getters and Setters
public String getCarId() { return carId; }
public String getBrand() { return brand; }
public String getModel() { return model; }
public double getBasePricePerDay() { return basePricePerDay; }
public boolean isAvailable() { return isAvailable; }
public void setAvailable(boolean isAvailable) { this.isAvailable = isAvailable; }
@Override
public String toString() {
return brand + " " + model;
}
}