As @Kon mentioned in his comment, an empty constructor in Java contains an implicit call to the superclass constructor.
Moreover, a non-empty constructor without an explicit call to super()
will have an implicit call at the top.
The only time when it is wrong to leave the super()
call there is if you intend to call a different superclass constructor yourself, with parameters.
See this question for more details.
Update: Consider the following code, which illustrates the scenario where it is wrong to leave the super()
generated by eclipse.
public class Foo{
public Foo(int a, int b) {
System.out.println("Foo constructor with-args is called");
}
public Foo() {
System.out.println("Foo with no-args is called");
}
}
class Bar extends Foo {
public Bar() {
// Implicit call to super()
super();
// Explicit call to super(a,b);
// This will not compile unless the call above has been removed.
super(1,2);
}
}