Ask Question
10 July, 19:51

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

+2
Answers (1)
  1. 10 July, 22:43
    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?
Get an answer to your question ✅ “What is the purpose of a destructor? (g) What is the purpose of an accessor? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers