Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I would greatly appreciate any help with my Programming project
That is my project that I've just started. I would like to thank anyone in advance for any help.
I'm still on part 1 right now. my first question is about the Vehicle class. I'm supposed to include the method [b]public abstract String getType();[/b]
--since it's an abstract method, the Vehicle class would have to abstract itself, correct? if the Vehicle class is abstract, then how can I instantiate Vehicle object in the VehicleTester class? I thought you were allowed to instantiate objects from abstract classes, yet the instructions include "[italic]test the Vehicle and Car classes by constructing several instances of
vehicles and cars, and printing enough information to test the accessor and toString
methods of these classes."[/italic]
My second question is about the method [b]public int compareMakeTo(Vehicle other)[/b] which compares two vehicles on the alphabetic order of their makes. I'm not exactly sure how I'm supposed to compare the strings. right now i return [italic]getMake().compareTo(other.getMake());[/italic], though I really don't know if that's right...
Again, thanks for any help. I might have a few more questions in the future.
0 · ·