What is the purpose of a destructor in OOP?

PYQ Bihar STET 2025PYQ Bihar STET 2024

What is the purpose of a destructor in OOP?

  1. A.

    To create instances of classes

  2. B.

    To handle exceptions

  3. C.

    To free up resources when an object is destroyed

  4. D.

    To define default values for properties

Attempted by 1487 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bihar Stet Computer Science Complete Course

Loading lesson…