I have a class that implements an interface, which in turn extends another interface. My code looks like this:
interface InterfaceOne {
default void log() {};
}
interface InterfaceTwo extends InterfaceOne {
void log();
}
public class TestClass implements InterfaceTwo {
@Override
public void log() {}
public static void main(String[] args) {}
}
Why should I implement in TestClass method log()? Isn't it correct that TestClass does inherit default void log() method which is defined in InterfaceOne? Because TestClass implements InterfaceTwo which extends InterfaceOne.
Why should I implement the log() method if is already defined in InterfaceOne?