1.

Which syntax among the following shows that a member is private in a class?(a) private: functionName(parameters)(b) private(functionName(parameters))(c) private functionName(parameters)(d) private::functionName(parameters)I have been asked this question in semester exam.My question is based upon Private Member Functions topic in section Member Functions & its Types of Object Oriented Programming

Answer»

Right option is (c) PRIVATE functionName(parameters)

Best explanation: The function declaration must contain private keyword FOLLOWER by the return type and function name. Private keyword is followed by NORMAL function declaration.



Discussion

No Comment Found

Related InterviewSolutions