Aryan PrajapatKnowledge Contributor
Is destructor overloading possible? If yes then explain and if no then why?
Is destructor overloading possible? If yes then explain and if no then why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
The simple answer is NO we cannot overload a destructor. It is mandatory to only destructor per class in C++. Also to mention, Destructor neither take arguments nor they have a parameter that might help to overload.
The destructor cannot be overloaded. It is not possible to overwhelm the destructor. In a class, we can only have one destructor. In a class followed by a class name, there can only be one destructor with no parameters and no return type.