Question: Java question An enum Vehicle is defined as shown in the class diagram. It contains A private String variable engineSize A private String variable capacity
Java question

An enum Vehicle is defined as shown in the class diagram. It contains A private String variable engineSize A private String variable capacity 3 enumerated values CAR, VAN and BUS. For each value an associated String engineSize - CAR: "2 litres" - VAN: "4 litres" - BUS:"12.5 litres" For each value an associated String capacity - CAR: "4 passengers" - VAN:"7passengers" - BUS: "29 passengers" A public method getEngineSize() that returns the engineSize of the enum A public method getCapacity() that returns the capacity of the enum Write the enum Vehicle in the answer box below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
