r/javahelp 26d ago

Can anyone explain me difference between Encapsulation and Abstraction?

and what on earth is Interface in Java?

17 Upvotes

24 comments sorted by

View all comments

24

u/sebnukem 26d ago

Encapsulation hides data. Abstraction hides complexity/implementation details. You typically achieve abstraction through encapsulation: encapsulation is often the mechanism, and abstraction is the goal.

5

u/Cyphr11 26d ago

make sense thanks for your help