0

What is class?

In class how can we hide the data. Abstract and encapsulation

30th Nov 2016, 9:00 AM
Sonu Baghel
Sonu Baghel - avatar
1 Odpowiedź
+ 2
[I am explaining Abstraction/Encapsulation based on my knowledge on C++/C# , I do not know if it may differ from Java] Abstraction shows only the relevant/useful data to the user while Encapsulation hides irrelevant/useless data from the user. Access specifiers like public, private, protected, etc are mostly used to do abstraction/encapsulation. There is also a get-set method used, the get method is used to retrieve value from private field and the set method is used for storing value in private variables.
30th Nov 2016, 9:39 AM
Wen Qin
Wen Qin - avatar