Note: All this data has been copied from various sources for the purpose of knowledge sharing. Data content can be either as it is or with little modification.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
Encapsulation prevents data from unwanted access by encapsulating data in a single object.
In a programming language, methods and properties that correspond to actions and attributes respectively are kept under a unit called object. The advantage of encapsulation is that the implementation is not accessible to the client. The user has to know only the functionality of encapsulated unit and information to be supplied to get the result.
Abstraction is supported using interface and abstract class while Encapsulation is supported using access modifiers e.g. public, private and protected.
In a programming language, methods and properties that correspond to actions and attributes respectively are kept under a unit called object. The advantage of encapsulation is that the implementation is not accessible to the client. The user has to know only the functionality of encapsulated unit and information to be supplied to get the result.
Abstraction is supported using interface and abstract class while Encapsulation is supported using access modifiers e.g. public, private and protected.







