It seems that mutator and accessor functions defeat the purpose of making the member variables private. Why is this not so?

What will be an ideal response?


The mutator functions can filter data and control the way data members are set. For example, you (as class author) can exclude illegal data. With accessor functions you (as class author) can allow the client to see just the variables you want seen, in the format in which you want them seen.

Computer Science & Information Technology

You might also like to view...

What are the critical success factors for Way Out?

What will be an ideal response?

Computer Science & Information Technology

If you want to be able to use a form of optical media (such as a CD or DVD) that you can write to as many times as you like, your media should be in ________ format

Fill in the blank(s) with correct word

Computer Science & Information Technology

The file extension for a Rich Text Format file is slx

Indicate whether the statement is true or false

Computer Science & Information Technology

What are some specific questions you would include in a questionnaire? Who should receive the questionnaire?

What will be an ideal response?

Computer Science & Information Technology