Interviewer: What is encapsulation and how do you achieve it in Java?
Me: Encapsulation is a mechanism to hide
The way i see it , Encapsulation refer to the idea of binding data and method to a single unit called class . However there are two main criteria to bind data and methods . One of them is information hiding, just not the only one . To be perfectly concise i would say the two main criteria are