Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are destructors overloadable?

enable_if doc page says:

Constructors and destructors do not have a return type; an extra argument is the only option.

Are destructors overloadable?

like image 770
pic11 Avatar asked Jun 05 '11 14:06

pic11


People also ask

Is destructor can be overloaded?

It is not possible to define more than one destructor. The destructor is only one way to destroy the object create by constructor. Hence destructor can-not be overloaded.

Can destructor be overridden?

Yes, it is possible to override the destructor of a class. In fact, when you define a class hierarchy in which polymorphism is used, you must declare a virtual destructor in the base class.

Are destructors called automatically C++?

A destructor is a member function that is invoked automatically when the object goes out of scope or is explicitly destroyed by a call to delete .

Can destructor be overloaded in Java?

Advantages of Destructor It does not accept any parameter and cannot be overloaded.


1 Answers

No


      

like image 67
Prasoon Saurav Avatar answered Sep 21 '22 03:09

Prasoon Saurav