1.

Which member function doesn’t require any return type?(a) Static(b) Constructor(c) Const(d) Constructor and destructorI have been asked this question during an interview.My question comes from Member Functions in chapter Class Members & Types of Object Oriented Programming

Answer»

Right choice is (d) CONSTRUCTOR and destructor

For EXPLANATION: All the member FUNCTIONS work same as normal functions with syntax. But the constructor and destructor are also CONSIDERED as member functions of a class, and they never have any data type.



Discussion

No Comment Found

Related InterviewSolutions