Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java question(Write a class in this question) An enum Vehicle is defined as shown in the class diagram. It contains A private String variable engineSize
Java question(Write a class in this 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: "7 passengers" - 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 belowStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started