© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
V. SarcarSimple and Efficient Programming with C# https://doi.org/10.1007/978-1-4842-8737-8_2

2. Abstract Class or Interface?

Vaskaran Sarcar1  
(1)
Kolkata, West Bengal, India
 

There are many code segments in which you can use an abstract class instead of a C# interface and vice versa. If the code is small and is used to perform a simple task, you may not see the difference between these two techniques. On the contrary, when the code is big and extendable, the choice between them can play a vital role in performance and maintenance.

This chapter doesn’t focus on the basic differences between an abstract class and an interface. Instead, I’ll show some code segments ...

Get Simple and Efficient Programming with C#: Skills to Build Applications with Visual Studio and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.