Computer Applications
A member method that returns the value of a private data member is called …………… .
- setter
- getter
- manager
- accessor
Encapsulation & Inheritance in Java
6 Likes
Answer
getter, accessor
Reason — Accessor methods are used to read values of private data members of a class which are not directly accessible in non-member methods.
Answered By
2 Likes
Related Questions
If a local variable is having the same name as that of a global class element, then it
- hides the global variable
- gets hidden by global variable
- produces an error
- none of the above
Java resolves duplicate variable name to ……………. .
- global variable
- local variable
- most local scope variable
- all the above
A member method that can change the value of a private data member is called …………… .
- setter
- getter
- manager
- accessor
What is encapsulation?