Tuesday, November 29, 2011
Core Java Interview Questions :Explain the Encapsulation principle.
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.:Encapsulation is the ability to hide implementation details by making class members(instance variables & methods) private or protected. So that you can make changes in your implementation code without breaking the code of others who use your code is a key benefit of encapsulation. :Encapsulation is one mechanism that enables the java developer to combine the data(can be attributes of an object),and actions (methods or behaviors) that perform on the data.:Encapsulation is one mechanism that enables the java developer to combine the data(can be attributes of an object),and actions (methods or behaviors) that perform on the data.:Encapsulation is a process of Wrapping data and functions into single unit.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment