OOPS
August 29, 2024OOPS
August 29, 2024OOPS
|
Question 136
|
In which case it is mandatory to provide a destructor in a class?
|
Almost in every class
|
|
|
Class for which two or more than two objects will be created
|
|
|
Class for which copy constructor
|
|
|
Class whose objects will be created dynamically
|
Question 136 Explanation:
→ Destructors are used to de-allocate the memory that has been allocated for the object by the constructor.
→ Unlike constructor a destructor neither takes any arguments nor does it returns value. And destructor can’t be overloaded.
→ Unlike constructor a destructor neither takes any arguments nor does it returns value. And destructor can’t be overloaded.
Correct Answer: D
Question 136 Explanation:
→ Destructors are used to de-allocate the memory that has been allocated for the object by the constructor.
→ Unlike constructor a destructor neither takes any arguments nor does it returns value. And destructor can’t be overloaded.
→ Unlike constructor a destructor neither takes any arguments nor does it returns value. And destructor can’t be overloaded.
