What is the difference between inheritance, encapsulation and polymorphism in C#?
Loading
What is the difference between inheritance, encapsulation and polymorphism in C#?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Aug 23, 2022, 3:16 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Aug 23, 2022, 3:51 AM EDT
Alkesh BijarniyaRank #237 · 10.4K reputationPosted Aug 23, 2022, 2:17 AM EDT
Vishal YelveRank #178 · 13.6K reputationPosted Aug 23, 2022, 3:30 AM EDT
Uday DodiyaRank #239 · 10.3K reputationPosted Aug 23, 2022, 1:21 AM EDT
Lalit HolkarRank #9,026 · 212 reputationPosted Sep 8, 2022, 7:12 AM EDT
There is a alot of diffrence in the Inheritance Encapsulation and the polymorphism few are below.
1. it is a technique to access base class functionality to the child class
2. It Help us in code Reusablity.
3. example you get everything which your father own.
1.In encapulation we encapsulate the data and function into one unit .
2. its provide us the accessibility Related stuff
3. example access modifiers like private public etc.
1.Polymorphism mean one thing many form
2. with the help of polymorphism we can provide additional functionality to the function ex. function overloading.
3. example change the earlier implementation of the function.
Patel134 reputationPosted Sep 8, 2022, 10:55 PM EDT
Rajeev KumarRank #1,334 · 1.3K reputationPosted Mar 3, 2023, 2:27 AM EST
Inheritance, polymorphism, and encapsulation comprise the three central characteristics of object-oriented (OO) programming. Inheritance allows you to create class hierarchies, where a base class gives its behavior and attributes to a derived class. You are then free to modify or extend its functionality. Polymorphism ensures that the proper method will be executed based on the calling object’s type. Encapsulation allows you to control access to your object’s state, while making it easier to maintain or change your implementation at a later date.