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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajanikant HawaldarPosted Aug 23, 2022, 7:16 AM
Rajeev KumarPosted Mar 3, 2023, 7:27 AM
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.
PatelPosted Sep 9, 2022, 2:55 AM
Lalit HolkarPosted Sep 8, 2022, 11:12 AM
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.
Sachin SinghPosted Aug 23, 2022, 7:51 AM
Vishal YelvePosted Aug 23, 2022, 7:30 AM
Alkesh BijarniyaPosted Aug 23, 2022, 6:17 AM
Uday DodiyaPosted Aug 23, 2022, 5:21 AM