- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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 an interface and an abstract class in C#?
Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the members.
Abstract classes to some extent serve the same purpose, however, they are mostly used when only a few methods are to be declared by the base class and the deriving class implements the functionalities.
The following are the differences −
A class may inherit more than one interface, whereas a class may inherit only one abstract class.
Multiple Inheritance cannot be achieved using Abstract whereas with Interface we can achieve it.
You cannot define fields in an Interface whereas it is defined in case of an abstract class.
An interface do not have public, private , protected , internal etc. access modifiers because in an interface by default everything is public.
- Related Articles
- Difference between Abstract Class and Interface in C#
- Difference between abstract class and interface
- Difference between Abstract Class and Interface in C# Program
- Difference Between Interface and Abstract Class in Java & C#
- What is the difference between an interface and a class in C#?
- Difference between Abstract Class and Interface in Java
- Differences between abstract class and interface in Java
- What is the difference between abstract class and a concrete class in Java?
- When to use an abstract class and when to use an interface in Java?
- What is the difference between a class and an object in C#?
- What are the differences between a class and an interface in Java?
- What is the difference between virtual and abstract functions in C#?
- Difference Between Class and Interface in Java
- What are the differences between an event listener interface and an event adapter class in Java?
- What happens if a class does not implement all the abstract methods of an interface in java?
