TipsOnLips.net

Your .net tips and tricks source

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010


Difference between abstract classes and interfaces (C#)

An interface is similar to an abstract class. Both types must be inherited.
You cannot create an instance of either. Abstract members require implementation in the derived type.
Interface members require implementation in a derived type. Although abstract and interface members are similar,
there are several differences:

   1. An abstract class can contain some implementation. Interfaces have no implementation
   2. Abstract classes can inherit other classes and interfaces. Interfaces can only inherit other interfaces.
   3. Abstract classes can contain fields. Interfaces cannot have state.
   4. Abstract classes have constructors and destructors. Interfaces have neither.
   5. Interfaces can be inherited by structures. Abstract classes are not inheritable by structures.
   6. Interfaces support multiple inheritance. Abstract classes support single inheritance.



Categories: C#
Posted by developer on Saturday, October 06, 2007 11:21 PM
Permalink | Comments (3) | Post RSSRSS comment feed

Comments

luxury hotel bangkok United States

Sunday, November 08, 2009 9:59 AM

luxury hotel bangkok

I loved the way you exlained things. Much better many here


Regards

Hughes

family law lawyers seattle United States

Friday, November 13, 2009 3:11 AM

family law lawyers seattle

I posted your blog to my facebook group


Regards
doctin

Walter Germany

Thursday, July 22, 2010 9:06 PM

Walter

sagabindara salutes you all out there

Add comment


(Will show your Gravatar icon)

  Country flag


Loading