|
You can offer the best of both worlds, an interface and an abstract class. Implementors can ignore your abstract class if they choose. The only drawback of doing that is calling methods via their interface name is slightly slower than calling them via their abstract class name.
http://mindprod.com/jgloss/interfacevsabstract.htm
created by java on 2008-04-28 00:18:25
|
|
Move from theory to practice on when to employ abstract classes vs. interfaces
http://www.javaworld.com/javaworld/javaqa/2001-08/
created by java on 2008-04-28 00:16:24
|
|
* use an abstract class, if you want to provide common implementation to subclasses,
* use an abstract class, if you want to declare non-public members,
* use an abstract class, if you want to be free to add new public methods in the future,
* use an interface if you're sure the API is stable for the long run
* use an interface if you want to provide the implementing classes the opportunity to inherit from other sources at the same time.
http://faq.javaranch.com/java/InterfaceVsAbstractC
created by java on 2008-04-27 23:54:44
|
|
abstract class defines core identity. If we are thinking in term of speed then abstract is fast then interface because interface requires extra in-direction.
So as per my view Abstract class having upper-hand in compare to interface. Using interface having only advantage of multiple inheritance. If you don’t understand the things then don’t worry because it’s my mistake because I am not able to describe the topic.
http://geekswithblogs.net/mahesh/archive/2006/07/0
created by java on 2008-04-27 23:49:42
|
|
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.
http://www.javaworld.com/javaworld/javaqa/2001-04/
created by java on 2008-04-27 23:23:28
|