Correct option is B
A destructor is a special function in object-oriented programming that is called automatically when an object goes out of scope or is explicitly deleted. It is used for cleanup actions like deallocating resources.
Important Key Points:
1. Destructors have the same name as the class, preceded by a ~ in languages like C++.
2. Destructors do not take parameters or return values.
Knowledge Booster:
· Constructor: Used to initialize an object.
· Overloader: A feature to define multiple behaviors for the same operator or function.
· Allocator: Responsible for memory allocation but not cleanup.