What are Destructors in Object-Oriented Programming
-
A type of member function that is automatically executed when an object of that class is destroyed is known as a destructor. The destructor has no return type and its name is same as class name. The constructor cannot return any value. It also cannot accept any parameters.
Also Read: A Detailed Guide to Constructors in Object-Oriented programming
The constructor name is preceded by tilde sign ~.
Syntax of Destructors
The syntax of declaring destructor is as follows
~name()
{
destructor body
}~name: It indicates the name of the destructor. The name must be same as the name of the class in which the constructor is declared
is it a correct about destructors further https://www.queryhelp.com
-
A type of member function that is automatically executed when an object of that class is destroyed is known as a destructor. The destructor has no return type and its name is same as class name. The constructor cannot return any value. It also cannot accept any parameters.
Also Read: A Detailed Guide to Constructors in Object-Oriented programming
The constructor name is preceded by tilde sign ~.
Syntax of Destructors
The syntax of declaring destructor is as follows
~name()
{
destructor body
}~name: It indicates the name of the destructor. The name must be same as the name of the class in which the constructor is declared
is it a correct about destructors further https://www.queryhelp.com
yaseen ramzan wrote:
is it a correct about destructors
Yes.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles