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 using interface and how to implement them Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "using interface and how to implement them" Watch "using interface and how to implement them" New topic

using interface and how to implement them

Duc Nguy

Joined: Nov 12, 2001
Posts: 7
I have to develop number of vehicle types using the following interface. How do i use them
public interface Driveable
public static final int LEFT = 0;
public static final int RIGHT = 1;
public void start();
public void stop();
public void accelerate();
public void decelrate();
public void turn (int direction);
I have to write an classs for van, sedan that implement the inerface. please help.
James Hobson
Ranch Hand

Joined: Aug 28, 2001
Posts: 140
you want something like this
* Put some javadoc here
public class Van implements Driveable {
public static void main(String args) {
Driveable aVanInstance = new Van();

public void start() {
//do something
public void stop() {
//do something
public void accelerate(){
//do something
public void decelrate(){
//do something
public void turn (int direction){
//do something
I agree. Here's the link:
subject: using interface and how to implement them
It's not a secret anymore!