Setter constructor

  • you call a parameter-less constructor to create the object and then call setter methods to set each required parameter and each optional parameter of interest.

Drawbacks

  • may be in an inconsistent state partway through its construction

  • precludes the possibility of making a class immutable.

Last updated

Was this helpful?