oop - Should Java classes call super() when they have no parent class? -
this question has reply here:
when need explicitly phone call superclass constructor? 3 answersis necessary or practice phone call super() when you're class has object parent?
i.e.
public class foo { public foo() { super(); // other stuff } } or
public class foo { public foo() { // other stuff } }
no. it's implicitly invoked, theres no reason phone call it.
java oop super
No comments:
Post a Comment