Skip to main content

What is the difference between abstract class and interface?

Mid C#
Quick Answer Abstract class: can have implementation, fields, and constructors รขโ‚ฌโ€ a class can inherit only one. Interface: defines only a contract with no implementation (historically) รขโ‚ฌโ€ a class can implement many. Use abstract class for shared behavior. Use interface for capabilities that unrelated types can share.

Answer

Abstract class: Can contain both implementation and abstraction.

Interface: Defines only the contract with no implementation (in traditional C#).

A class can inherit one abstract class but implement multiple interfaces.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice