I have been asked in interview...
what is
void getData()
and public void getData()
.
Is it data hiding or encapsulation. as i know class is encapsulation . can u please clear my understanding. I have read some online documents but they are saying making private variables is data hiding and change them through methods is encapsulation..
Asked
Active
Viewed 37 times
0

Ousmane D.
- 54,915
- 8
- 91
- 126

Mayur
- 11
- 6
-
well one thing a `void` Getter method is: very confusing. – Mark May 28 '18 at 14:04
-
hey sorry .. lets say any return type. – Mayur May 29 '18 at 08:37
-
Hi Got it thnx ..what i understtod is .. mainly abstraction is generalizing and encapsulation is method, and abstraction and encapsulation is inter-related to each other. – Mayur May 29 '18 at 09:12