![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between overriding and shadowing in C#?
The following are the differences between overriding and shadowing −
Shadowing redefines the complete method, whereas overriding redefines only the implementation of the method.
In Overriding, you can access the base class using the child class’ object overridden method.. Shadowing has cannot access the chaild class methos.
Shadowing is also known as method hiding. The method of the parent class is available to the child class without using the override keyword in shadowing. The child class has its own version of the same function.
Under overriding, you can define a behavior that is specific to the subclass type, which means a subclass can implement a parent class method based on its requirement.
Advertisements