Sunday 7 August 2011

Difference B/W abstract and Interfaces in .NET

Abstract Class

It can contain Fields
It can contain members with definition when they are not declared as abstract.
You can specify access modifier for the members.
By default members are private.
It can contain static members
It can contain constructors and destructor
It doesn’t support multiple inheritance.

Interface

It can not contain fields
It can not contain definition for any member
It is not possible to specify an access modifier for the members.
By default members are public.
It can not contain static members.
It can not contain constructors and destructor.
It supports multiple inheritance.

1 comment: