1.

Which among the following is true?(a) Member functions can never be private(b) Member functions can never be protected(c) Member functions can never be public(d) Member functions can be defined in any access specifierThe question was posed to me in an international level competition.This is a very interesting question from Types of Member Functions in section Member Functions & its Types of Object Oriented Programming

Answer»

Correct ANSWER is (d) Member functions can be defined in any ACCESS SPECIFIER

The best EXPLANATION: The member functions can be defined inside any specifier. There is no restriction. The programmer can APPLY restrictions on its use by specifying the access specifier with the functions.



Discussion

No Comment Found

Related InterviewSolutions