Click here to Skip to main content
15,902,114 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Why we compare abstract class with interface? Abstract class supposed to be compare with Sealed class not with Interface. Please guys correct me if I m wrong?

Many thanks in advance !!!
Posted
Updated 28-Oct-14 5:00am
v4

In a sense both 'Abstract Classes and Interfaces provide a template for Classes that inherit from them.

I don't see why you would compare an Abstract Class with a Sealed Class: you cannot inherit from a Sealed Class, and the major use of an Abstract Class is to specify and-or provide functionality for inheriting Classes.
 
Share this answer
 
Actually, comparing Abstract class with Interface makes more sense than comparing it with a Sealed one.
Abstract class and an Interface could serve similar purposes, while Sealed class is somewhat antithetic to bot Abstract class and Interface.
 
Share this answer
 
v2
 
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