Script(s)

what I learn is what u c

Interface vs Base Class (.Net)

leave a comment »

Interface is similar to a base class, it is also very different.

They are similar..

– Both provide structure to another class that uses them

– Both can be used for polymorphism
Interfaces are different than base classes ..

– A class can inherit only one base class, but it can implement many interfaces. (Very important)

– A base class can contain implementation, an interface cannot contain implementation

– Interfaces can only contain Methods, Properties, Indexers, and Events. They cannot contain fields or constants (which are used for implementation)

Advertisements

Written by gchandra

August 29, 2007 at 4:40 pm

Posted in Asp.Net, Interview Qn

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: