Monday, August 17, 2009

Difference Between Interface and Abstract Class

Interfaces
--contain only abstract methods
--interface can't be inherited from a class
--using interfaces we can achieve multiple inheritance
--doesn't allow accessibility modifiers (Public/Private/Internal)
--can't contain fields, constructors
--is must implementable & its scope is upto any level of its inheritence chain.

Abstract Class
--contain both abstract methods as well as concrete methods
--can extend another class and implement multiple interfaces
--we can't achieve multiple inheritance
--allows accessibility modifiers
--can contain fields, constructors
--class Abstract class is must inheritable & its scope is upto derived class

No comments: