Following code is compiling absolutely fine.
To my understanding it should not be because Class C
implementing interface I
as abstract class fails to compile as well.
interface I {
public String toString();
}
class C implements I {
}
Abstract class is not compiling
abstract class MyAbstractClass {
public abstract String toString();
}
public class MyClass extends MyAbstractClass {
}
Please help me understand this behavior why abstract is not compiling and interface does ?