Sunday, 15 June 2014

oop - Should Java classes call super() when they have no parent class? -



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 answers

is 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