File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help" Watch "Help" New topic


Duc Nguy

Joined: Nov 12, 2001
Posts: 7
I have to use a helper functions in the driver class with main to help with the driving. The paterrn for the Test drive is the following.
public class TestDrivable
public static final int LEFT = 0;
public static final int RIGHT = 1;
public static goForward(Drivable vechicle)
public static turn(Drivable vehicle, int direction)
public static void main(String [] args)
Van mini = new Van;

I have no idea what this mean can you help me clarify on what i should do to make this whole thing work
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059

Start by making a Van class that defines the methods you are calling: accelerate(), decelerate(), and turn( direction ). If Drivable is an interface, Van needs to implement Drivable. If Drivable is an abstract class, Van needs to extend Drivable. You cannot call methods you do not have defined, and you cannot create a Van without defining what a Van is.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: Help
It's not a secret anymore!