1.

Any changes made to static data member from one member function _____________(a) Is reflected to only the corresponding object(b) Is reflected to all the variables in a program(c) Is reflected to all the objects of that class(d) Is constant to that function onlyI had been asked this question in a job interview.This is a very interesting question from Static Data Members topic in division Exception Handling & Static Class Members of Object Oriented Programming

Answer»

The CORRECT choice is (C) Is reflected to all the objects of that class

The BEST explanation: The changes made from any function to static data member will be a COMMON change for all the other objects also. If the change is made with respect to one object and change is printed from another object, the RESULT will be same.



Discussion

No Comment Found

Related InterviewSolutions