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
How to display all the prime numbers between 1 and 100
What are the types of inner classes (non-static nested class) used in java?
Explain about sets?
Can a class be declared as static?
What is equlas() and hashcode() contract in java? Where does it used?
Why is static used?
What are the advantages of user defined functions?
Discuss 2D arrays.
What is the benefit of singleton pattern?
Why do we create threads in java?
Difference between error and exception
What are thread groups?
What is a function argument in java?
Explain spliterator in java8?
What is an example of a boolean?