Click to See Complete Forum and Search --> : I need some help Pleaeseee?


Beavis
October 5th, 1999, 11:17 PM
I came across a problem where I have to implement a takeTestDrive method that takes two parameters:vehicle of type Car and miles of type int. The former is the Car object being test-driven and the later is the number of miles driven. The method adds the miles indicated to the mileage instance field or variable of the Car object. (I have a Car class created already)

I have followed the text guide and attemped the following...

public vehicle takeTestDrive(vehicle car)
{
return(car);
}

public int takeTestDrive(int mileage)
{
return(mileage);
}

...But then when I compile it...this comes up...

C:\>javac Customer1.java
Customer1.java:62: Class vehicle not found.
public vehicle takeTestDrive(vehicle car)
^
1 error

...am I missing something here...your help is very much appreciated...

unicman
October 6th, 1999, 12:36 AM
It is a bit confusing. From the description, i assume that u have created a class called 'Car'. It has all these methods.

Now I didn't understand what is 'vehicle'. It is not a std. datatype, so it has to be a class. That's why compiler is giving error that 'vehicle' class not found.

I think, here 'car' is a variable which can hold objects of class 'vehicle'. Do u want the same thing? If yes, u need to have 'vehicle' class.

- UnicMan
http://members.tripod.com/unicman