Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is different between an abstract and an Interface class in C#?

What is different between an abstract and an Interface class in C#?

like image 229
Aidin Avatar asked Dec 17 '22 16:12

Aidin


1 Answers

An interface is not a class, it is just a contract that defines the public members that a class must implement.

An abstract class is just a class from which you cannot create an instance. Normally you would use it to define a base class that defines some virtual methods for derived classes to implement.

like image 155
Xint0 Avatar answered Dec 21 '22 23:12

Xint0