Ask Question
26 November, 03:20

What is the purpose of a destructor? (g) What is the purpose of an accessor?

+2
Answers (1)
  1. 26 November, 05:29
    0
    Destructor:-To free the resources when lifetime of an object ends.

    Accessor:-To access private properties of the class.

    Explanation:

    The purpose of a destructor is to free the resources of the object that it has acquired during it's lifetime. A destructor is called once in the lifetime of the object that is also when the ifetime of the object ends.

    The purpose of the accessors is to access private properties of the class. Accessor cannot change the value of the private members. They are also called getters.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is the purpose of a destructor? (g) What is the purpose of an accessor? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers