Where and how can you use a private constuctor.

Q

Where and how can you use a private constuctor.

✍: Guest

A

Private constructor can be used if you do not want any other class to instanstiate it by using new. The instantiation is done from a static public method, which is used when dealing with the factory method pattern.

2012-08-17, 2033👍, 0💬