Can we have a private constructor ?

Answer Posted / aj

Yes, only if we want to prevent instantiation from other
class, but then the class itself cannot be sub classed.

this the heart of singleton design pattern

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between inheritance and polymorphism?

577


• What are the desirable attributes for memory managment?

1732


How do you answer polymorphism?

580


What is the point of polymorphism?

594


Whats oop mean?

601






What are the 4 pillars of oop?

674


What is polymorphism in oops with example?

535


Can abstract class have normal methods?

616


Please send ford technologies placement paper 2 my mail id

1660


What are the benefits of oop?

609


What is the problem with multiple inheritance?

588


Why multiple inheritance is not allowed?

586


What language is oop?

599


What is static in oop?

591


What is constructor overloading in oop?

607