- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Abstract Class and Interface 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 few methods are to be declared by the base class and the deriving class implements the functionalities.
Let us now see the difference between Abstract class and Interface in C#.
A class may inherit more than one interface, whereas a class may inherit only one abstract class.
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.
Multiple Inheritance cannot be achieved using Abstract whereas with Interface we can achieve it.
- Difference between abstract class and interface
- Difference between Abstract Class and Interface in C# Program
- Difference between Abstract Class and Interface in Java
- Difference Between Interface and Abstract Class in Java & C#
- What is the difference between an interface and an abstract class in C#?
- Differences between abstract class and interface in Java
- Difference Between Class and Interface in Java
- Difference Between Thread Class and Runnable Interface in Java
- What is the difference between abstract class and a concrete class in Java?
- What is the difference between an interface and a class in C#?
- Differences between abstract class and concrete class in Java
- Difference between IComparable and IComparer Interface in C#
- Difference between IEnumerator and IEnumerable Interface in C#
- Differences between Interface and class in Java
- Difference between Traits and Abstract Classes in Scala.