0

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..

Ousmane D.
  • 52,579
  • 8
  • 80
  • 117
Mayur
  • 1
  • 4
  • 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

0 Answers0