1.

Which among the following is false for class features?(a) Classes may/may not have both data members and member functions(b) Class definition must be ended with a colon(c) Class can have only member functions with no data members(d) Class is similar to union and structuresThis question was addressed to me in an interview for internship.This question is from Classes in division OOPs Concept & Features of Object Oriented Programming

Answer» RIGHT choice is (b) Class DEFINITION MUST be ended with a colon

The best explanation: Class definition must END with a semicolon, not colon. Class can have only MEMBER functions in its body with no data members.


Discussion

No Comment Found

Related InterviewSolutions