java - Can i call a method of the class in constructor and which arguments will it get? -
can call method of class in constructor , arguments get? instance have
i need set string object, when create it.
but not via constructor arguments.
interface { void set(string s); } public class b implements { string s; public void set(string s) { smthn } public b(s) { set(???); }
can call method of class in constructor
yes, it's considered bad idea call instance method on object while being constructed.
and arguments get?
the ones pass it. implied argument instance object this
Comments
Post a Comment