Do we have private destructors?

Answer Posted / guest

RE: #1

You can have private constructors. It's pretty common
practice when you create a class which you want to never be
constructed with "new" from outside the class (for example,
if you have a static factory member of the class).

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pointer with example?

648


What is null pointer and void pointer and what is their use?

572


What are single and multiple inheritances in c++?

564


Write a program to find the reverse Fibonacci series starting from N.

593


Are there interfaces in c++?

545






What are the manipulators in c++?

535


You run a shell on unix system. How would you tell which shell are you running?

639


What is the difference between *p++ and (*p)++ ?

764


What is polymorphism & list its types in c++?

606


What is encapsulation in C++? Give an example.

576


What is the first name of c++?

553


What is the maximum combined length of command line arguments including the space between adjacent arguments?

586


Where are setjmp and longjmp used in c++?

602


What do you mean by ‘void’ return type?

591


Can you explicitly call a destructor on a local variable?

589