I have one class and two interfaces
public class A implements B, C { public static void main(String[] args) { A a = new A(); a.foo(); } } public interface B { default void foo(){ System.out.println("foo in B"); } } public interface C { void foo(); } The thing i'm concerned about is that java doesn't compile this giving an error that I must implement method from C. Hence I have a question. Why doesn't the default body cover that part, I mean the only thing java must be concerned about is that all the methods have their implementations, right? But for the class A, it's obvious that the implementation is given in B.
So why is java giving that error?