Ask Question

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

+1
Answers (1)
  1. 8 November, 04:55
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers