Tuesday, April 10, 2007
What is Data Encapsulation?
Subscribe to:
Post Comments (Atom)
World of tricky Core Java Q&A(Java SE),Java EE and Open source technologies like Struts,Hibernate,Spring,Velocity etc
Disclaimer
Interview Questions On Java,Java EE Copyright © 2012
9 comments:
Wrapping data and function into single unit is called encapsulation
Good Answer Nishanth....
In other words, data encapsulation is basically binding together data and the methods that act on that data, into a single unit.
In other words, data encapsulation is basically binding together data and the methods that act on that data, into a single unit.
encapsulation means class have a modifier like: private, protected and public.
private : other class can not access the data.
public : can access.
protected : class in different package can not access the data.
therefore its called data hiding.
data encapsulation have a class modifier :
private : differnt class can not access data.
public : can access.
protected : class in different package can not access.
therefor, its called data hiding.
data encapsulation have a class modifier :
private : differnt class can not access data.
public : can access.
protected : class in different package can not access.
therefor, its called data hiding.
data encapsulation have a class modifier :
private : differnt class can not access data.
public : can access.
protected : class in different package can not access.
therefor, its called data hiding.
It is a mechanism to bind attributes and behaviours together to avoid outside interference and misuse
Post a Comment