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

Advantage and disadvantage of routing in telecom sector

786


What is the purpose of enum?

581


What are the 4 main oop principles?

685


What is oops?what is its use in software engineering?

557


Which is not an object oriented programming language?

537






What is difference between oop and pop?

613


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1633


Why multiple inheritance is not allowed?

581


What exactly is polymorphism?

604


What is solid in oops?

600


Get me an image implementation program.

1557


What are the 5 oop principles?

601


What is data binding in oops?

586


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2758


What is difference between data abstraction and encapsulation?

615