I have an abstract superclass Vehicle, derived class Car, and derived class CompactCar:
public abstract class Vehicle
{
public Vehicle(String Model, int Mileage, String VIN)
{
pModel = Model;
pMileage = Mileage;
pVIN = VIN;
}
//abstract public String getVehicleInfo();
abstract public void setReservation(boolean reservation);
abstract public boolean getReservation();
abstract public String getVehicleType();
abstract public String getVehicleNumber();
abstract public int getMileage();
//private data members
private int pNumberOfSeats;
private boolean pIsReserved;
private String pVIN;
private int pMileage;
}
//car class
public Car(String Model, int Mileage, String VIN)
{
super(Model, Mileage, VIN);
pVIN = VIN;
pModel = Model;
pMileage = Mileage;
}
//driver program
Car c = new CompactCar("Nissan", 20, "23537HYHU5");
int i = 0;
i = c.getMileage();
This keeps throwing an error saying no identifier in the above line.
How do I fix this??
2006-10-01
14:55:00
·
1 answers
·
asked by
The Disciple
2