Q:

The Differences between Abstraction and Encapsulation in C#?

0

The Differences between Abstraction and Encapsulation in C#?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

# Abstraction Encapsulation
1. Abstraction solves the problem at design level. Encapsulation solves the problem at the implementation level.
2. Abstraction is set to focus on the object instead of how it does it. Encapsulation means hiding the internal details or mechanics of how an object does something.
3. Abstraction is used for hiding the unwanted data and giving only relevant data. Encapsulation is hiding the code and data into a single unit to protect the data from the outer world.
4. Abstraction is implemented using interface & abstract class. Encapsulation is implemented using private & protected access modifiers.
5. Abstraction is outer layout in terms of design. Encapsulation is inner layout in terms of implementation.
e.g. Outer Look of an iPhone, like it has a display screen. Inner Implementation detail of an iPhone, how Display Screen are connected with each other using circuits.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Top 100 C# interview questions and answers 2022

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Explain sealed class in C#?... >>
<< What is oops and what are the different properties...