You can also use factories to build complicated objects of only a single class that must be built-in stages, when there are too many parameters to handle conveniently with a constructor. You want to avoid allowing any malformed or partly-formed objects loose out into the universe.
In Javadoc, click USE to discover factory methods that will produce objects of the current class. Often there is no public constructor and you have to dig around to find the corresponding factory method in some other class. It is not formally linked to the class it is the factory for.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.16] |
| ||
| You are visitor number 48,917. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/factorymethod.html | J:\mindprod\jgloss\factorymethod.html | ||