I know that the Abstract Class looks like the Interface one.
but I'am sure that there is a certain difference between them.
so, i wish from you to provide me with those differences.
Thanks in advanced.
The difference between the Abstract Class and the Interface.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Dylan Morley2 pointsPosted Aug 11, 2006, 5:07 AM EDT
(I've lifted this the below from a Java site!!)
An interface allows somebody to start from scratch to implement your interface or implement your interface in some other code whose original or primary purpose was quite different from your interface. To them, your interface is only incidental, something that have to add on to the their code to be able to use your package.
An abstract class, in contrast, provides more structure. It usually defines some default implementations and provides some tools useful for a full implementation. The catch is, code using it must use your class as the base. That may be highly inconvenient if the other programmers wanting to use your package have already developed their own class hierarchy independently.
Choosing interfaces and abstract classes is not an either/or proposition. If you need to change your design, make it an interface. However, you may have abstract classes that provide some default behavior. Abstract classes are excellent candidates inside of application frameworks.