How abstraction and encapsulation differ

0 votes
I'm getting ready for an interview, so I decided to brush up on my OOP knowledge. Hundreds of articles are available, yet each one appears to describe them differently. Some suggest

"The process of recognising common patterns with systematic variations; an abstraction represents the common pattern and gives a mechanism of defining the variation to utilise,"  is abstraction

Other say

Abstraction means to show only the necessary details to the client of the object

The same is the case with encapsulation.

The problem with me is that athough I can implement these, I am not able to come up with proper difference between encapsulation and abstraction. Let's say if I were to be in an interview on this question, I think I would mess up because I think they are very relatable.

Any answers?
Jun 9 in C# by pranav
• 2,580 points
24 views

1 answer to this question.

0 votes
They are, in my opinion, slightly different notions, although they are frequently used interchangeably. Encapsulation is a design philosophy that involves building items that are equivalent to familiar objects/processes to aid understanding, whereas abstraction is more of a design philosophy that involves making products that are analogous to familiar objects/processes to aid understanding. Encapsulation is simply one of several abstraction techniques available.

Consider the word "windows." They are simply graphical squares on the screen, not windows in the classic sense. However, thinking of them as windows is helpful. That's a euphemism.

Encapsulation occurs when the "windows API" hides the intricacies of how text or graphics are physically produced within the limits of a window.
answered Jun 9 by rajiv
• 1,620 points

Related Questions In C#

0 votes
1 answer

Encapsulation vs abstraction real world example

Encapsulation is a technique for "information concealment," ...READ MORE

answered Jun 21 in C# by jyoti
• 1,240 points
41 views
0 votes
1 answer

How to quickly code and run small C# code

I personally use this LINQPad for this. ...READ MORE

answered Jun 23 in C# by krishna
• 2,540 points
23 views
0 votes
1 answer

How and when to use ‘async’ and ‘await’

The compiler creates a state machine in ...READ MORE

answered Jul 4 in C# by krishna
• 2,540 points
17 views
0 votes
1 answer

A good and complete tutorial about reflection in .NET?

First, go to this link http://www.codeproject.com/Articles/55710/Reflection-in-NET Also, you ...READ MORE

answered Jun 6 in C# by pranav
• 2,580 points
29 views
0 votes
1 answer

Object Oriented Programming Basic Concept(C#)

Use this link https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers protected internal: The type or ...READ MORE

answered Jun 17 in C# by jyoti
• 1,240 points
18 views
0 votes
1 answer

Examples of dynamic polymorphism in c#

Check the example of polymorphism below. We ...READ MORE

answered Jun 7 in C# by pranav
• 2,580 points
33 views
0 votes
1 answer

Encapsulation of subclasses from a constructor in C#

If you think about it in terms ...READ MORE

answered Jun 11 in C# by pranav
• 2,580 points
21 views
0 votes
1 answer

What is the difference between a field and a property

The internal workings of a class should ...READ MORE

answered Jun 21 in C# by jyoti
• 1,240 points
14 views
0 votes
1 answer

How can I compile and run c# program without using visual studio

If you have.NET Framework v4 installed, then C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe ...READ MORE

answered Jun 9 in C# by rajiv
• 1,620 points
31 views
0 votes
1 answer

What are the differences between C, C# and C++ in terms of real-world applications?

C is a bare-bones, straightforward, and clean ...READ MORE

answered May 30 in C# by rajiv
• 1,620 points
30 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP