Monday, 28 March 2016

Real life example of Encapsulation

Real life example of Encapsulation

Hello friends here we discuss a little bit about Encapsulation and Real life example of Encapsulation. This is the main feature of any object-oriented programming language.
Encapsulation.

Encapsulation is nothing but wrapping the data and functions into a single entity.

Real life example of Encapsulation

Real-life example of Encapsulation

A simple example of Encapsulation is a mobile phone; No need to know the internal working of the mobile phone to operate it just enough to know about how to call and other features. You have an interface to use the device behavior without knowing implementation details.

Difference between Abstraction and Encapsulation

The main difference between Abstraction and Encapsulation is; Abstraction is logical part like what data you want to show to the customer...  but encapsulation Hides unnecessary data which is not important for the customer

2 comments: