This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
please help
Posted by Jase on November 24, 2001 at 1:48 PM
why am i getting this message ??? ive included code fred.java:31: engageDrive(int) in carFerry cannot be applied to () stenaFerry.engageDrive(); CAR FERRY /* class to model a car ferry captain*/ import java.io.*; class stenacaptain { public static void main(String [] args) { carFerry stenaFerry=new carFerry(); /* create an instance of class carFerry */ stenaFerry.currentDrive=0; stenaFerry.bowDoors = true; stenaFerry.closeDoors(); System.out.println("closing the bow doors"); System.out.println("The bow doors are now closed"); stenaFerry.currentDrive=-1; stenaFerry.engageDrive(); System.out.println("Engaging Reverse Drive"); System.out.println("Reverse Drive now engaged"); stenaFerry.currentDrive=1; stenaFerry.engageDrive(); System.out.println("Engaging Forward Drive"); System.out.println("Forward Drive now engaged"); stenaFerry.disengageDrive(); System.out.println("NEUTRAL Drive now engaged"); stenaFerry.engageDrive(); System.out.println("Opening the Bow Doors"); stenaFerry.openDoors();
} } CAPTAIN /* class to model a car ferry captain*/ import java.io.*; class fred {
public static void main(String [] args) { carFerry stenaFerry=new carFerry(); /* create an instance of class carFerry */ stenaFerry.bowDoors = true; stenaFerry.closeDoors(); System.out.println("closing the bow doors"); System.out.println("The bow doors are now closed");
(THE FAULT IS IN THE NEXT LINE) stenaFerry.engageDrive(1);
System.out.println("Engaging Reverse Drive");
System.out.println("Reverse Drive now engaged"); stenaFerry.engageDrive(1); System.out.println("Engaging Forward Drive"); System.out.println("Forward Drive now engaged"); stenaFerry.disengageDrive(); System.out.println("NEUTRAL Drive now engaged"); stenaFerry.engageDrive(); System.out.println("Opening the Bow Doors"); stenaFerry.openDoors(); } }
Replies:
|