what is the use of declaring constructor as private?
Answer Posted / ranganathkini
By declaring the class constructor as private, other classes
cannot create instances of the class.
This design is usually used in singleton patterns.
| Is This Answer Correct ? | 22 Yes | 2 No |
Post New Answer View All Answers
Is it possible for yielded thread to get chance for its execution again ?
What is tochararray in java?
What does nullpointerexception mean?
Can a class extend 2 classes in java?
What is size_t?
Can we use a switch statement with strings?
What is thread safe singleton?
How is string stored in java?
What is the purpose of the main method?
What is garbage collector?
What is a method vs function?
What are three advantages of using functions?
what is mena by object block any what is the use of that
What is queue in java?
Define linked list and its features with signature?