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)

Written by gchandra

August 29, 2007 at 4:40 pm

Posted in Asp.Net, Interview Qn

Leave a Reply