1.

Which is correct syntax to access the static member functions with class name?(a) className . functionName;(b) className -> functionName;(c) className : functionName;(d) className :: functionName;The question was asked during an online interview.This question is from Static Member Functions topic in division Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Correct option is (d) className :: functionName;

EASIEST EXPLANATION - The scope resolution operator must be used to access the static member functions with CLASS name. This indicates that the function belongs to the CORRESPONDING class.



Discussion

No Comment Found

Related InterviewSolutions