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
How many types of threads are there in java?
When throws keyword is used?
Which access specifier can be used with class ?
Write a program to check for a prime number in java?
What is the main functionality of the remote reference layer?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
Can you instantiate the math class in Java?
When is the finalize() called? What is the purpose of finalization?
What is stream api in java8?
What is binary tree in java?
What is linked hashmap and its features?
What is the difference between an interface and an abstract class?
Explain the transient field modifier?
Explain about transient variables in java?
What is compareto () in java?