1.

Why do classes use mutator methods?(a) Allows client to modify the program(b) Allows client to modify/write the private members(c) Allows servers to access all the private data(d) Allows servers to access only protected membersThis question was posed to me during an interview.My question is from Class Use in division Classes of Object Oriented Programming

Answer»

Correct OPTION is (b) Allows CLIENT to modify/write the private members

The best EXPLANATION: The client can have rights to access a file and write something to it. This is mandatory to keep the private data updated. Also it is an ADVANTAGE over the use of hidden CLASS members.



Discussion

No Comment Found

Related InterviewSolutions