Thursday, February 14, 2013

Abstract Class vs Interface

Posted by Rahul Kharde at 2:06 AM

Declare With keyword “Interface
Declare with keyword “Abstract
A class may inherit several interfaces.
A class may inherit only one abstract class.
An interface cannot provide any code, just the signature.
An abstract class can provide complete, default code and/or just the details that have to be overridden.
No fields can be defined in interfaces
An abstract class can have fields and constrants defined
An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public
An abstract class can contain access modifiers for the subs, functions, properties
It can come in inheritance chain
In that this is not come in inheritance chain
It will not contain constructor
It will may or may not constructor
It will only contain final variable
It will contain Final and instance variable

If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you subscribe to my regular Email Updates. Subscribe Now!

Kindly Bookmark and Share it:



Babu Kumararasamy on April 19, 2016 at 6:00 AM said...

The modifier 'abstract' is not valid on fields. Try using a property instead.

Have any question? Feel Free To Post Below:


Popular Posts

Recent Comments

© 2011. All Rights Reserved | Help to understand .Net | Template by Blogger Widgets

Home | About | Top