I know Constructors are not inheritable in java, we need to use super() - super must be the first statement in Constructors.
But why cant i use @Override
annotation?
In example:
public class Foo extends Point2D.Double {
@Override // The annotation @Override is disallowed for this location
public Foo(){}
}
If i have a instance of Foo, i never ever can call Point2D.Double.Double()
directly! This behave is compleatly like Overriding!
public Foo(int i){super();}
wont be able to be have an@Override
and Oracle-Developers are too foul to check if the arguments match!super()
is the same as callingPoint2D.Double.Double()
directly. Even if you don't writesuper();
in your constructor it is called anyways. And callingsuper()
is not overriding - it is simply using a constructor of another class. Using is not overriding.Point2D.Double.Double()
, removedsuper();
and debug the creation of aFoo
. Unfortunately my Breakpoint didnt debug! Are you sure that i dont need to callsuper();
?