interface A
{
public void f();
public void g();
}
class B implements A
{
public void f()
{
System.out.println("B.f()");
}
}
public class Main
{
public static void main(String[] args)
{
B tmp = new B();
tmp.f();
System.out.println("B.f()");
}
}
I don't implement all the method in the interface A in B and it has a error that
The type B must implement the inherited abstract method A.g()
but why it can get the output that
B.f()
B.f()