Possible Duplicate:
Interface vs Abstract Class (general OO)
I'm not exactly clear on the difference.
Thanks
Possible Duplicate:
Interface vs Abstract Class (general OO)
I'm not exactly clear on the difference.
Thanks
They are quite similar but there are some important technical differences:
These differences affect how the two techniques should be used:
An interface doesn't allow definition of any of the member methods, whereas an abstract class does allow some or all to be defined. A class however can only extend one class (abstract or not) but can implement as many interfaces as it wants.
I like to think of an interface as a contract. any class that implements an interface, must provide details on what to do when any method defined in the contract is called. An abstract class is a class that defined a set of actual behaviors, ie more than just a contract to be implemented later, but that class can't be instantiated.