Where and how can you use a private constructor?
Answer / Aniket Shukla
A private constructor can be used within a class to prevent other classes from creating objects of that specific class. It ensures that the class acts as an abstract class. A private constructor cannot be accessed outside the class.
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the difference between HashMap and Hashtable
17 Answers Value Labs, Virtusa,
What is meant by oops concept in java?
What is anonymous inner class?
What is flush () in java?
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
What is singletonlist in java?
what is j2se
Define how does a try statement determine which catch clause should be used to handle an exception?
What do you mean Abstraction in java?
why using interface interface ?
What is a protected method?
what is difference betwwen hashmap and hashtable ?