1.

The static data member __________________________(a) Can be accessed directly(b) Can be accessed with any public class name(c) Can be accessed with dot operator(d) Can be accessed using class name if not using static member functionThis question was addressed to me in an online interview.Enquiry is from Static Data Members in chapter Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Right CHOICE is (d) Can be ACCESSED using class name if not using static member function

Easiest explanation - The static data members can be accessed using the class name also. If the member functions is not USED or is not to be used then we can call the static data members DIRECTLY by using its corresponding class name.



Discussion

No Comment Found

Related InterviewSolutions