Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You would like to create a collection of classes for things you can drive ( e . g . Boat, Plane, Car, Bike, Skateboard )
You would like to create a collection of classes for things you can "drive" eg Boat, Plane, Car, Bike, Skateboard in Java. Every class should include the methods steerLeftint amount steerRight int amount brakeint amount and accellerate int amount Because the controls are so different between each class, no default methods will be provided for any of these. Each class will have to provide its own code. Which of the following would be more appropriate to use in this case?
An abstract class called Vehicle
An interface called Driveable
An exception handler
An ArrayList of Objects: ArrayListbject allVehicles;
Step 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