Latest Tutorials| Questions and Answers|Ask Questions?|Site Map


View Questions and Answers by Category


Have Programming Question? Ask it here!

1 Answer(s)      4 years and 9 months ago
Posted in : Java Interview Questions

where we use encapsulation in programs?
how we know that is encapsulated?

View Answers

May 5, 2010 at 4:40 PM

Hi Friend,

Encapsulation is a process of binding or wrapping the data into a single entity.This helps in hiding an object's data describing its state from any further modification by external component.

When we want to keep the data safe from outside interface and misuse, we have to use the encapsulation feature.It hide the details by making the fields in a class private and providing access to the fields via public methods.


Related Tutorials/Questions & Answers: