what is private constructor?what are the uses of writing
private constructor in our program?
Answer Posted / christian
a common use for a private constructor is to implement the
singletton pattern, which uses a public member variable of
the same type of the class which is defined. A public
getInstance() method uses this private constructor
| Is This Answer Correct ? | 13 Yes | 6 No |
Post New Answer View All Answers
How many arguments can a method have java?
Why can't you declare a class as protected?
What is pangram in java?
What is the original name of java?
Is array dynamic in java?
What does math floor () do?
How many types of equations are there?
What state does a thread enter when it terminates its processing in java programming?
What super () does in java?
How can we use primitive data types as objects?
What is serialversionuid?
What does pointer mean?
When can an object reference be cast to an interface reference in java programming?
Why doesn't the java library use a randomized version of quicksort?
How many threads can I run java?