interface CFL extends PowerSaver, LightingDevice{
void showLifeTime();
void getBrand();
}
interface PowerSaver {
void showEcoRate();
}
interface LightingDevice {
void doLight();
}
public abstract class Philips implements CFL{ void showLifeTime(){}; // ! => Cannot reduce the visibility of the inherited method from CFL. void showEcoRate(){}; // ! => Cannot reduce the visibility of the inherited method from CFL. }
Interface implementations must be
To understand the error, see the spec:
public
.To understand the error, see the spec:
Every method declaration in the body of an interface is implicitlyTherefore, you're actually overriding (or, in this case, implementing)public
.
public
methods.
No comments:
Post a Comment