问题
Is it necessary or good practice to call super()
when you're class only has Object
as a parent?
i.e.
public class Foo {
public Foo() {
super();
// Other stuff
}
}
or
public class Foo {
public Foo() {
// Other stuff
}
}
回答1:
No. It's implicitly invoked, so theres no reason to call it.
来源:https://stackoverflow.com/questions/24308447/should-java-classes-call-super-when-they-have-no-parent-class