I have interface Car:
public interface Car {
void run();
}
Also i have a base class that implements this interface:
public class Base implements Car {
@Override
public void run() {
//some implementation here
}
}
Also i have one more class that must implement Car interface
So why i can not do something like that?
public class Der extends Base implements Car {
//no implementation of interface here because Base class already implements it
}
Why my base class can not implement interface? What is internal reason of this?
implements, notimplement. Andextendsmust be beforeimplements. So:public class Der extends Base implements Carextendsmust come beforeimplements, for example,public class Der extends Base implements Car {, but has already been pointed out, that would the same as usingpublic class Der extends Base {Baseclass is implementing the interfaceCar