I have a Base interface:
public interface Doable {
void doAction(String str);
}
I have an interface:
public interface DoubleDoable extends Doable{
@Override
default void doAction(String str) {
doOnce();
doOnce();
}
void doOnce();
}
And I have an implementation:
public class Action implements DoubleDoable {
public void doOnce() {
System.out.println(123);
}
}
However, it does not compile like: Error:(10, 8) java: Action is not abstract and does not override abstract method doAction(java.lang.String) in Doable
Am I doing something wrong?
source
share