InterviewSolution
Saved Bookmarks
| 1. |
Which among the following is true for use of setter() and getter() function?(a) Considered best for manipulating data values(b) Considered the only proper way to manipulate the values(c) Considered specially for private members manipulation(d) Considered a red flag, and not recommended for large scale useI have been asked this question in an international level competition.The above asked question is from Data Members topic in chapter Class Members & Types of Object Oriented Programming |
|
Answer» CORRECT option is (d) Considered a red flag, and not recommended for large scale use The best explanation: This CONCEPT of getter and setter functions is not acceptable if used too much. This is considered to be inappropriate in OOP perspective. Though it is commonly used, it doesn’t work according to OOP CONCEPTS at some HIGHER level of understanding. |
|