Explain the Encapsulation principle.

By: Karthik  

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.

Most Viewed Articles (in Interview )

Explain the new Features of JDBC 2.0 Core API?

How to define an Abstract class?

Interview Question: Can i map more than one table in a CMP?

Interview Question: What is the difference between sessioncontext and entitycontext?

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

Interview Question: What is lazy loading?

Interview Question: What is the difference between EAR, JAR and WAR file?

Interview Question: Is Decorator an EJB design pattern?

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

What are implicit Objects available to the JSP Page?

Interview Question: Can I invoke Runtime.gc() in an EJB?

Interview Question: What are the optional clauses in EJB QL?

Explain garbage collection?

Interview Question: What is the difference between ejbCreate() and ejbPostCreate?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Latest Articles (in Interview)

Comment on this tutorial