Tuesday, December 4, 2007

the different between an abstract class and an interface

an abstract class can still have implementation. an interface can't have implementation or member variables.

a.net class can derive from only one base class, even if that base class is abstract. However, a .net class can implement as many interfaces as required.

an abstract class can derive from any other class or from one or more interfaces.

an abstract class can have nonpublicc methods and prperties, even if they are all abstract. In an interface, by definition, all members are public.

an class can have static methods and static members and can define constants. an interface can have none of those.

an abstract class can have constructors. an interface can't

No comments: