what is the use of declaring constructor as private?
Answer Posted / ranganathkini
By making all the constructors of a class private, you can
also prevent other class from extending the class without
marking the class final.
| Is This Answer Correct ? | 9 Yes | 6 No |
Post New Answer View All Answers
What is the purpose of the runtime class in java programming?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What is difference between == equals () and compareto () method?
Explain naming conventions for packages?
What is the difference between a local variable and an instance variable?
Are there structures in java?
What do you know about the garbage collector?
What are the basic concepts of OOPS in java?
How do you trim a space in java?
How to sort array of 0 and 1 in java?
What is method overloading in JAVA? Why is it not present in C ?
What is finalize() function in java?
What is java object name?
Where and how can you use a private constructor?
How finally used under exception handling?