vote buttons
1
1
beginner
0
intermediate
0
advanced
18-Dec-2014 04:08 UTC
K Bonneau
336

1 Answers

vote buttons
2

Superficially, both interfaces and abstract classes are look similar, but there are a few important differences:

An interface is a contract, and any class which implements the interface has to abide by the contract by providing an implementation of the methods and/or properties which the interface declares. An interface cannot contain any code. A class can implement any number of interfaces.


An 
abstract class is a class which cannot be instantiated. It contains at least one abstract method (method with no definition) or property and can contain members and other function definitions like a normal class (in c# a class can be marked as abstract even if it doesnt have any abstract members). A class cannot implement more than one class (abstract or not).

18-Dec-2014 04:09 UTC
K Bonneau
336