what is the use of private constructor in core java?
Answer Posted / rakesh
Private constructor can be used if we do not want any other
class to instantiate the class. This concept is generally
used in Singleton Design Pattern. The instantiation of such
classes is done from a static public method.
| Is This Answer Correct ? | 54 Yes | 3 No |
Post New Answer View All Answers
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
Define jre i.e. Java runtime environment?
Why scanner is used in java?
Is string an object?
Is singleton class thread safe?
Which java ide is used the most?
What is an infinite loop in java? Explain with an example.
Why char array is favored over string for the storage of passwords?
What is the default size of set in java?
Can static methods be inherited?
How do you implement tree mirroring in java?
What are meta-annotations?
Which data type is a class in java?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
What are the differences between stringbuffer and stringbuilder?