| SrNo | Abstract Class | Interface | 
|---|---|---|
1 
 | 
Abstract class is a class that contain complete  and abstract (incomplete) both types of members  | 
Interface is a type which contains only the signatures of methods, delegates or events | 
2 
 | 
Abstract class can be inherited by other classes  but cannot be instantiated.  | 
Interfaces are implemented by a class | 
3 
 | 
A class can inherit only one abstract class | A class can implement multiple interfaces | 
4 
 | 
Abstract class can contain data members, constructors | Interface doesn't contain data members, constructors | 
5 
 | 
We can not achieve multiple inheritance | We can achieve multiple inheritance | 
6 
 | 
Can contain access modifiers like public, private, protected, etc. for functions, snubs, properties. | Doesn't contain access modifies. By default, everything is public. | 
7 
 | 
Members of abstract class can be static. | Members of interface cannot be static. | 
Search This Blog
Friday, June 13, 2014
Difference between Abstract Class and Interface
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment