📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Which of the following is true about C++

    destructors?
    A Must have the same name as the class Correct Answer Incorrect Answer
    B Are called automatically when an object goes out of scope Correct Answer Incorrect Answer
    C Can have parameters Correct Answer Incorrect Answer
    D Must return int Correct Answer Incorrect Answer
    E Can be overloaded Correct Answer Incorrect Answer

    Solution

    Destructors free resources automatically; they cannot have parameters or return types.

    Practice Next
    ask-question