WHAT IS THE DIFFERENCE BETWEEN CLASS AND AN INTERFACE?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
C# 
C#
 1352  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What is the difference between class and an Interface?

    Abstract classes can have implementations for some of its members, but the interface can't have implementation for any of its members.

    Interfaces cannot have fields where as an abstract class can have fields.

    An interface can inherit from another interface only and cannot inherit from an abstract class, where as an abstract class can inherit from another abstract class or another interface.

    A class can inherit from multiple interfaces at the same time, where as a class cannot inherit from multiple classes at the same time.

    Abstract class members can have access modifiers where as interface members cannot have access modifiers.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!