+ 3
What was difference between destructors and contractors
Since destructors can't take parameters, they also can't be overloaded. Each class will have just one destructor.
3 Respostas
+ 2
in the constructors you create the objects by saving their data in memory.
in the destructor you delete the objects data from the memory.
you can have different constructors because you can create an object from different type of data. but you can only destroy a created object in one way, by deleting all of its data from memory.
+ 1
both are member function of class with the class name only.but constructor is specified with return type statement but destructor is not specified with any return type statement.constructor gets invoked when its object is created whereas destructor gets invoked when object goes out of scope
+ 1
Basically constructor is use to initialize the value ,so we can use it for initialize value.And destructor is use for deallocate the memory to the variable