Difference between interface and abstract classes

Posted on October 15 2009 by Sachin Jain

Following are the 6 differences between abstract classes and interfaces :-

1) A class can implement as many interfaces, but an subclass at most one abstract class.

2) Abstract class can have non abstract methods but all methods of interface are abstract.

3) Abstract class can declare and use variables but interface cannot.

4) Interface don’t have different access modifiers, they all are public.

5) Abstract class can define constructors but interface cannot.

6) A class which implements the interface need to define all methods declared in interface but this situation is not mandatory in case of abstract classes

VN:F [1.9.0_1079]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.0_1079]
Rating: 0 (from 0 votes)

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Powered by Sachin Jain

Powered by Olark