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, 2022 in C# by pranav
• 2,590 points
865 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, 2022 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, 2022 in C# by jyoti
• 1,240 points
13,312 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, 2022 in C# by krishna
• 2,820 points
505 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, 2022 in C# by krishna
• 2,820 points
529 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, 2022 in C# by pranav
• 2,590 points
497 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, 2022 in C# by jyoti
• 1,240 points
643 views
0 votes
0 answers

Object Oriented Programming Basic Concept(C#)

As We know The Default Modifier of Class, Struct, ...READ MORE

Dec 9, 2022 in Android by Edureka
• 13,620 points
470 views
0 votes
0 answers

Object Oriented Programming Basic Concept(C#)

We are aware that the default modifier ...READ MORE

Dec 12, 2022 in C# by Roshan
• 300 points
457 views
0 votes
1 answer

Examples of dynamic polymorphism in c#

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

answered Jun 7, 2022 in C# by pranav
• 2,590 points
841 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, 2022 in C# by rajiv
• 1,620 points
1,272 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, 2022 in C# by rajiv
• 1,620 points
666 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP