what is the use of declaring constructor as private?
Answer Posted / anshul
A private constructor is a special instance constructor. It is commonly used in classes that contain static members only. If a class has one or more private constructors and no public constructors, then other classes (except nested classes) are not allowed to create instances of this class.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How would you format a date in java? I.e. In the ddmmyyy format?
Is empty set an element of empty set?
Can I overload to string method
Can we override the overloaded method?
what is meant by HQL?
What is the longest unicode character?
What is size_t?
Can we overload the methods by making them static?
What java ide should I use?
What is autoboxing and unboxing?
What is a singleton in genetics?
What is mutable object and immutable object?
How many types of variables are there?
What are the different types of garbage collectors in java?
What is sortedset in java?