what is private constructor?what are the uses of writing
private constructor in our program?
Answer Posted / sirisha
a constructor which is declared with private accesspecifer,
we can call it is private constructor,so that we can nt
create object from out side of the class, in this way we
can provide security to our class
| Is This Answer Correct ? | 39 Yes | 8 No |
Post New Answer View All Answers
Can we declare an interface as final?
What is the benefit of inner / nested classes ?
What is the syntax and characteristics of a lambda expression?
Is it necessary that each try block must be followed by a catch block?
What is anagram of a string?
What is a subsequence of a string?
What is the use of bufferedreader?
Can we have two main methods in a java class?
Can a class be declared as static?
Which is better singleton or static class?
How to create an interface?
Define an abstract class with reference to java.
Explain about the dynamic behavior of core java?
What was java originally called?
What is a numeric format?