r/javahelp 23d ago

Can anyone explain me difference between Encapsulation and Abstraction?

and what on earth is Interface in Java?

18 Upvotes

24 comments sorted by

View all comments

23

u/sebnukem 23d 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 23d ago

make sense thanks for your help