1.

Which syntax among the following is correct for public member functions?(a) public::void functionName(parameters)(b) public void functionName(parameters)(c) public(void functionName(parameters))(d) public:-void functionName(Parameters)I got this question by my school teacher while I was bunking the class.This intriguing question originated from Public Member Functions topic in portion Member Functions & its Types of Object Oriented Programming

Answer»

Correct answer is (B) public void functionName(parameters)

The explanation is: The public member functions declaration must be MENTIONED with the KEYWORD public. The SYNTAX given is USED in java. Keyword public is followed by the usual function declaration.



Discussion

No Comment Found

Related InterviewSolutions