+ 3

What is the difference between constructor and destructor??

24th May 2017, 1:36 PM
Sasirekha
Sasirekha - avatar
6 Answers
+ 4
constructor is used to initialize the instance of class as he said. and destructor is when the object is deleted or destroyed which is no longer in needed
24th May 2017, 1:45 PM
Sasirekha
Sasirekha - avatar
+ 2
this is not an exact answer
24th May 2017, 1:39 PM
Sasirekha
Sasirekha - avatar
+ 2
Constructor is a special member function whose task is to initialise an object of it's class. & Destructor is a special member function whose task is to destroy the object created by constructor. Which gets called automatically when program ends.
24th Apr 2018, 12:55 PM
Jayesh Patil
Jayesh Patil - avatar
- 1
constructor is used when we want to execute some fuction after runtime...
24th May 2017, 4:07 PM
Zeeshan Salam
Zeeshan Salam - avatar