Can we have a private constructor ?

Answer Posted / namrata ahuja

no. constructors are always declared publicly. they are used
to initialize data members of a class. they are
automatically invoked by a class object declaration so if it
is private it cannot be invoked.

Is This Answer Correct ?    6 Yes 39 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

561


What is byval and byref? What are differences between them?

1693


What are the 3 pillars of oop?

623


What does it mean when someone says I oop?

587


What are the three parts of a simple empty class?

1462






What is object and class in oops?

590


Why it is called runtime polymorphism?

579


any one please tell me the purpose of operator overloading

1967


Are polymorphisms mutations?

706


What does and I oop mean?

620


What is the real life example of polymorphism?

611


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2764


How do you answer polymorphism?

580


what type of questions

1697


What are the 4 main oop principles?

687