Sunteți pe pagina 1din 5

In Focus

C# Corner
Progressive Web App Section Announced
Abstraction andAskEncapsulation
a Question Contribute

Jignesh Trivedi Jun 13 2012 Blog

2 8 154.5k

Download 100% FREE Spire O ce APIs


Abstraction

Abstraction allows us to represent complex real world in simplest manner. It is process of identifying the relevant
qualities and behaviors an object should possess, in other word represent the necessary feature without representing
the back ground details. Abstraction is a process of hiding work style of an object and showing only those information
which are required to understand the object. Abstraction means putting all the variables and methods in a class which
are necessary.

Encapsulation

It is a process of hiding all the internal details of an object from the outside real world. The word Encapsulation, like
Enclosing into the capsule. It restrict client from seeing its internal view where behavior of the abstraction is
implemented. In Encapsulation, generally to hide data making it private and expose public property to access those
data from outer world. Encapsulation is a method for protecting data from unwanted access or alteration.
Encapsulation is the mechanism by which Abstraction is implemented.

Di erence between Abstraction and Encapsulation

Abstraction is a process. It is the act of identifying the relevant qualities and behaviors an object should possess.
Encapsulation is the mechanism by which the abstraction is implemented.

Abstraction Encapsulation
Abstraction solves the problem in the
Encapsulation solves the problem in the implementation level.
design level.
Abstraction is used for hiding the
Encapsulation is hiding the code and data into a single unit to
unwanted data and giving only relevant
protect the data from outer world.
data.
Abstraction is set focus on the object Encapsulation means hiding the internal details or mechanics
instead of how it does it. of how an object does something.
Abstraction is outer layout in terms of
Encapsulation is inner layout in terms of implementation.
design.
For Example: - Inner Implementation detail of a iPhone, how
For Example: - Outer Look of a iPhone, like
Display Screen are connect with each other using circuits
it has a display screen.
Download 100% FREE Spire O ce APIs

Abstraction and Encapsulation

Jignesh Trivedi

Jignesh Trivedi is a Developer, C# Corner MVP, Microsoft MVP, Author, Blogger,eager to learn
new technologies
http://www.c-sharpcorner.com/members/jignesh-trivedi

Ask a Question

10 11.1m 5 2

2 8

Type your comment here and press Enter Key (Minimum 18 characters)

Nice Article.................
Sujeet Suman Oct 19, 2015
349 3.9k 125.9k 0 0 Reply

Nice Explain Sir.............


Pankaj Kumar Choudhary Jul 03, 2015
35 25.6k 2.2m 0 0 Reply

nice demonstration sir..


Upendra Pratap Shahi Jul 03, 2015
153 9.7k 697.2k 0 0 Reply

nice examples sir


Khargesh Rajput May 29, 2015
241 5.5k 240.3k 0 0 Reply

"Encapsulation is accomplished by using Class. - Keeping data and methods that accesses that data
into a single unit" "Abstraction is accomplished by using Interface. - Just giving the abstract
information about what it can do without specifying the back ground details"
RS Prajapati Apr 17, 2015
1425 18 5.2k 0 0 Reply

very good way.....to explain Abstraction and Encapsulation, it has closed many doubt of my mind.
Sharad Gupta Jan 17, 2015
58 19.3k 3.7m 0 0 Reply

nice
vikas kumar Oct 18, 2013
NA 0 0 0 0 Reply

awesome
ankit patel Apr 08, 2013
1428 15 916 0 0 Reply

Comment Using
0 Comments Sort by Oldest

Ask a Question
Add a comment...

Facebook Comments Plugin

File APIs for .NET


Aspose are the market leader of .NET APIs for le business formats natively work with DOCX,
XLSX, PPT, PDF, MSG, MPP, images formats and many more!

LATEST BLOGS
Browse Web App With Multiple Browsers

FizzBuzz In C#

SharePoint 2013 - Retract Solution - Access Denied Error

Debug With Customized Browser Window Size

Change Sharepoint ListView To Jquery Accordion Using JSLink - CSR

How To Get Data From List Beyond Threshold Limit Through Calmquery

Change The SharePoint List View Into JQuery News Ticker Using JS Link - CSR

Download All PDF File From MS Site URL Using Powershell

Retrieve Images From SharePoint Document Library Particular Folder Using C#

DDL, DML, DQL, DCL, TCL in SQL


View All

Follow @csharpcorner 96.2K followers


C# Corner
1,282,900 likes

Ask a Question

Like Page Learn More

Be the first of your friends to like this

Philadelphia
New York
London
Delhi

Join C# Corner
A community of 2.3 million developers worldwide

Enter your email address Sign Up

Learn ASP.NET MVC Learn ASP.NET Core Learn Python Learn JavaScript Learn Xamarin
Learn Oracle More...
Home Events Consultants Jobs Career Advice Stories

About Us Contact Us Privacy Policy Terms Media Kit Sitemap Report a Bug FAQ
2017 C# Corner. All contents are copyright of their authors.

S-ar putea să vă placă și