Basically I am running a boating simulation and I have all of the "harder" parts done but one error is holding me back from compiling my code.
I won't go into detail about the simulation but basically I have a Boat super class and extended from this are the sub classes; cruiser, speedboat, and jetski.
My problem is when it comes to accessing methods in the cruiser, speedboat, and jetski classes.
For example here is a section of my code (the context is unimportant)
Expand|Select|Wrap|Line Numbers
- if (getBoat(i).getType() == "cruiser"){
- Boat v = getBoat(i);
- return v;
- finished = true;
- }
So my question is how can I get this part of my method to convert or accept the object so that there is no type mismatch.
I'm happy to quickly provide any other information that may help you solve my problem.
Regards
GX