1.

Which among the following is true?(a) Private member functions can’t be overloaded(b) Private member functions can be overridden(c) Private member functions can’t be overloaded with a public member(d) Private memberfunction can’t be overriddenI had been asked this question in semester exam.Question is from Private Access Specifier topic in division Access Specifiers of Object Oriented Programming

Answer»

The correct option is (d) Private memberfunction can’t be OVERRIDDEN

The explanation: The private member functions can be OVERLOADED but they can’t be overridden. This is because, overriding means a FUNCTION with same name in derived class, GETS more priority when called from object of derived class. Here, the member function is private so there is no way that it can be overridden.



Discussion

No Comment Found

Related InterviewSolutions