Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
In c#, an abstract class is supposed to compare with concrete class? Why most of the authors are comparing abstract class with interface?
Posted
Updated 19-May-14 4:33am
v3
Comments
Sergey Alexandrovich Kryukov 19-May-14 12:10pm    
Ask those authors. I personally don't know where somebody "compares" them. Making a choice between abstract class and interface is the usual consideration.
—SA

Because both contains only signatures of methods and usually everyone doesn't know when to use abstract class and where to use interface.
 
Share this answer
 
If you have a notion that abstract class can only be compared to concrete class, then it is incorrect. In a decent article or book, you would find comparison to both. It is predominantly to understand why it exists and when to use it.
 
Share this answer
 
Please see my comment to the question and my past answers. The choice is not trivial. I've collected the links to all my past answers on one:
Doubts on Interfaces[^].

—SA
 
Share this answer
 
Using an interface you have to implements every metod tha you declare, and with the abstract not, i believe thats the diference, if iam wrong please tell me.
 
Share this answer
 
Generally people compare these two because when a abstract class contains only abstract methods then it can be called as interface.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900