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

Answer Posted / udaychow

only once instance of a particular class is allowed.through
private constructor only we can achieve singleton design
pattern.

Is This Answer Correct ?    8 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create an interface?

822


Can a string be null?

733


What is dynamic binding(late binding)?

790


What are data types in programming?

752


What is an immutable class? How to create an immutable class?

776


What is a numeric digit?

772


Explain throw keyword in java?

818


Can we have multiple catch block for a try block?

782


What is intern method in java?

796


What is the difference between method overriding and overloading?

807


What is the difference between an object-oriented programming language and object-based programming language?

766


What is the purpose of return statement?

820


How many bytes is a char in java?

768


What are some characteristics of interference class?

751


What is scope & storage allocation of static, local and register variables? Explain with an example.

792