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.
Loading
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.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dylan MorleyPosted Aug 11, 2006, 9:07 AM
(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.