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


Please Help Members By Posting Answers For Below Questions

Can we write any code after throw statement?

844


Define nashorn in java8.

815


Why is java architectural neutral?

875


What is JDBC Driver interface?How can you retrieve data from the ResultSet

1796


Is java util regex pattern thread safe?

767


How do you access command-line arguments within the code?

824


How to change the priority of thread or how to set the priority of thread?

840


Can a constructor be protected?

822


What are keywords in programming?

800


What is a super method?

772


Can we use string in switch case in java?

838


What is a linkedhashmap java?

791


Explain about object oriented programming and its features?

823


What is a default method?

779


Can an unreferenced object be referenced again?

960