Pages

Sunday, June 11, 2017

Difference Between Interface and Abstract Class

Difference Between Interface and Abstract Class


Interfaces
--contain only abstract methods
--interface cant be inherited from a class
--using interfaces we can achieve multiple inheritance
--doesnt allow accessibility modifiers (Public/Private/Internal)
--cant 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 cant achieve multiple inheritance
--allows accessibility modifiers
--can contain fields, constructors
--class Abstract class is must inheritable & its scope is upto derived class

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.