What is the difference between constructor & destructor?
S.no | Constructor | Destructor |
---|---|---|
1. | It allocates the memory to an object. | It deallocates the memory of an object. |
2. | It accepts argument. | It does not take an argument. |
3. | In a class, there can be multiple constructors. | In a class, there can only be one destructor. |
BY Best Interview Question ON 02 Mar 2019