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
If we don’t want some of the fields not to serialize how to do that?
What kind of variables can a class consist?
Explain restrictions for using anonymous inner classes?
Can you declare an interface method static?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
How do generics work in java?
Can a static class have a constructor java?
What is volatile keyword in java
What is a top level class in java?
Explain java coding standards for methods?
What is module with example?
What is the function of log?
What is the basic concepts of OOPS?
What is covariant return type?
Why is it called buffering?