-
Notifications
You must be signed in to change notification settings - Fork 0
/
OOPsCar024B.java
23 lines (20 loc) · 906 Bytes
/
OOPsCar024B.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class OOPsCar024B {
private String make = "Tesla";
private String model = "Model X";
private String color = "Grey";
private int doors = 2;
private boolean convertible = true;
public String getMake() { return make; }
public String getModel() { return model; }
public String getColor() { return color; }
public int getDoors() { return doors; }
public boolean isConvertible() { return convertible; }
public void setMake(String make) { this.make = make; }
public void setModel(String model) { this.model = model; }
public void setColor(String color) { this.color = color; }
public void setDoors(int doors) { this.doors = doors; }
public void setConvertible(boolean convertible) { this.convertible = convertible; }
public void describeCar() {
System.out.println(doors + "-door " + color + " " + make + " " + model + " " + (convertible ? "Convertible" : ""));
}
}