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

Java question An enum Vehicle is defined as shown in the class

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!