-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicleTest.java
More file actions
29 lines (27 loc) · 1.21 KB
/
VehicleTest.java
File metadata and controls
29 lines (27 loc) · 1.21 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
class VehicleTest {
public static void main(String[] args) {
Vehicle redVehicle = new Vehicle("red");
String color = redVehicle.getColor();
System.out.println("The Vehicle color is: " + color);
}
}
//Vehicle bike = new Vehicle();
//Vehicle car = new Vehicle();
//Vehicle motorcycle = new Vehicle();
//bike.setNumberOfWheels(2);
//bike.setColor("red");
//int bikeWheels = bike.getNumberOfWheels();
//String bikeColor = bike.getColor();
//car.setNumberOfWheels(4);
//car.setColor("blue");
//int carWheels = car.getNumberOfWheels();
//String carColor = car.getColor();
//motorcycle.setNumberOfWheels(2);
//motorcycle.setColor("black");
// int motorcycleWheels = motorcycle.getNumberOfWheels();
//String motorcycleColor = motorcycle.getColor();
//System.out.println("Bike object - Wheels: " + bikeWheels + ", Color: " + bikeColor);
//System.out.println("Car object - Wheels: " + carWheels + ", Color: " + carColor);
//System.out.println("Motorcycle object - Wheels: " + motorcycleWheels + ", Color: " + motorcycleColor);
//}
//}