My Thoughts & Views

Difference Between Interface and Abstract Class

Posted on: August 17, 2009

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

Advertisements

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: