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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -