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
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
What are adapter classes?
Explain about map interface in java?
How will you invoke any external process in java?
What are the 7 types of characters?
What is the difference between preemptive scheduling and time slicing in java programming?
Can I learn java without any programming experience?
How do you find the maximum number from an array without comparing and sorting?
What is the significance of listiterator?
What is difference between next () and nextline () in java?
What is java english?
Does chrome use java?
What does bitwise or mean?
Why main function is static?
What is jrmp?