1.

The syntax for defining the static data members is __________(a) dataType className :: memberName = value;(b) dataType className : memberName = value;(c) dataType className . memberName = value;(d) dataType className -> memberName =value;

Answer» Correct answer is (a) dataType className :: memberName = value;

To explain I would say: The syntax doesn’t contain the static keyword. Since it is already been declared as static inside the class. The data type and the corresponding class name must be there to allocate the variable to a class. The value is assigned using scope resolution operator for the member name.


Discussion

No Comment Found

Related InterviewSolutions