Wednesday, December 7, 2011

Difference between an abstract class and interface Class


eature
Interface
Abstract class
Declaration and implementation of Methods
Contain only declaration of functions and methods. It does not provide implementation of methods.
We Can provide default implementation of methods.
Implement Every Method or Override every method
The derived class must implement all the methods of interface.
Not necessary to implement all methods.
Fields and Constants
Fields can not be define
Fields can be define.
Access Modfiers
An interface cannot have access modifiers for the functions, properties etc everything is assumed as public
An abstract class can contain access modifiers for the functions, properties

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo