what is private constructor?what are the uses of writing
private constructor in our program?

Answer Posted / neha

In Private Construtor is that
1. We used The Private acess Modifier
2. In Private Construtor We can Not Create the instance Of
this Class in Outside Class
3. We can used only Static Data Member In Private Construtor

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class have an interface?

741


Why constructor has no return type?

827


Is class is a data type?

797


Is an empty arraylist null?

792


What is the difference between an if statement and a switch statement?

887


How do you ensure that n threads can access n resources without deadlock?

1071


What kind of variables can a class consist?

792


What is return keyword in java?

801


Is there any limitation of using inheritance?

797


What is the difference between keyword and identifier?

779


What are the difference between composition and inheritance in java?

732


What is extension method in java?

789


What is string made of?

732


What are the features of java?

736


define polymorphism in java

843