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
What is a class instance variable?
What is multiple inheritance? Is it supported by java?
Where are global variables stored?
What is the main method java?
Which browsers work with java?
What is gc()?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
What is array class in java?
Explain the importance of finalize() method.
Explain about static nested classes in java?
What is the difference between Java1.4 and Java1.5
What is difference between printf and scanf?
What are thread groups?
What is a void method?
What is the symbol for average?