Explain the Encapsulation principle.

By: Karthik Printer Friendly Format    


Answer: Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper.

Ask a Question



Most Viewed Articles (in Interview )

What are all the different scope values for the tag?

Interview Question: Is there a particularly good IDE to use with Struts ?

Interview Question: How many EJB Objects are created for a Bean?

Interview Question: What is deployment descriptor?

What is transient variable?

How to define an Abstract class?

What is the difference between jsp:include page and @ include file?

What are implicit Objects available to the JSP Page?

Interview Question: What is Struts?

Interview Question: What is Struts Validator Framework?

Interview Question: Why does EJB needs two interfaces(Home and Remote Interface)?

Interview Question: Is Decorator an EJB design pattern?

Interview Question: What is lazy loading?

Interview Question: What is Message Driven Bean?

Interview Question: What is local interface. How values will be passed?

Latest Articles (in Interview)

Comment on this tutorial