Let me explain my situation:
public class Car extends Vehicle{
public Car() { }
public Car(String model){
super(model);
AutoParts autoParts=new AutoParts(Car.this.getSuperClass); //get compile error here
}
}
public class AutoParts{
Vehicle _Vehicle;
public AutoParts() { }
public AutoParts(Vehile vehicle){
this._Vehicle=vehicle;
}
}
Sorry for the horrible example. But during the initialization, Ford ford=new Ford(Car.this.getSuperClass);
, I want to be able to pass an instance of the superclass as a parameter to the constructor.
How do I do it? How do I get the instance of a superclass?
**
Edit:
Class name, Ford
renamed to AutoParts