top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Where and how can you use a private constructor in Java ??

+2 votes
150 views
Where and how can you use a private constructor in Java ??
posted Mar 18, 2014 by Ashwini Miraj

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Source: http://www.javabeat.net/qna/819-where-and-how-can-you-use-a-private-construct/
Private constructor can be used if you do not want any other class to instanstiate the object , the instantiation is done from a static public method, this method is used when dealing with the factory method pattern when the designer wants only one controller (fatory method ) to create the object.

answer Mar 19, 2014 by Pavan P Naik
Similar Questions
...