Can anyone give me the difference between encapsulation and abstraction in a technical perspective | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone give me the difference between encapsulation and abstraction in a technical perspective

java

5th Oct 2018, 3:42 AM
Karankumar
2 Answers
0
The difference is, they are different things. Encapsulation is data hiding, exposing only the information you need. It controls what parts of the class can be modified or accessed by you or other programmers. Abstraction is the process of extracting common functionality to a class, or logically grouping things to make an object that represents the work you need doing. Well abstracted code is easier to maintain and understand, as it represents a solution to the problem you are coding for
5th Oct 2018, 5:40 AM
Dan Walker
Dan Walker - avatar
0
thanks mate.can please give me an example program for that
5th Oct 2018, 6:22 AM
Karankumar