Jesper de Jong wrote:
How are your Eclipse settings; are the compiler compliance settings set to Java 7 compatibility?
Hello. I've made sure that the JDK compliance in Eclipse is set to 1.7. But now that I've investigated the issue more, I think it's Oracle's compiler that is faulty.
The Java specification says:
A declaration d of a method named n shadows the declarations of any other methods named n that are in an enclosing scope at the point where d occurs throughout the scope of d.
And
method name is defined to be only the identifier without the argument list if I understood correctly.
Furthermore, the code compiles only if the method is overridden and not a completely new definition. This works:
but if I remove "extends B", then I get the error "actual and formal argument lists differ in length".