Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c#
abstract class
interface

Abstract class vs. Interface in C#

Educative Answers Team

Abstract class

Interface

1. Abstraction

Abstraction is one of the most powerful features of object-oriented programming. It is a way to provide users with only the most relevant and essential information​​ while hiding the rest.

Abstract classes don’t provide complete abstraction – they can have concrete methods along with the abstract ones.

Interfaces provide complete abstraction; however, they can not have concrete methods.

svg viewer

2. Constructors

A constructor is the special method of a class ​used to initialize the objects of the class.

svg viewer

Abstract classes can have different types of constructors.

Interfaces cannot have constructors.

3. Multiple inheritance

Inheritance is another feature of object-oriented programming where a particular class can derive from a base class. Multiple inheritance allows the extension of more than one base class in a derived class.

Abstract classes do not support multiple inheritance.

Interfaces support multiple inheritance.

RELATED TAGS

c#
abstract class
interface
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring