In an abstract class, you can have many methods that are implemented but leave some methods abstract so that different subclasses don't have to redo the work that's been done and they can override the abstract methods for their application.
The best way to use an abstract class is as a way to partially implement an interface, letting multiple other classes extend it and complete the implementation. One example of this in the Java APIs is the class java.util.AbstractList. A number of other classes extend it, but no-one normally thinks about that. It just provides a sort of "starter implementation" of java.util.List. Other classes fill in the details.
But there are classes which are fully abstract? I mean all of their methods are abstract. In that situation, what are the reasons to declare them abstract rather then declaring them an interface?
Partially implementing a class is one fact, but stil it's not the actual reason for declaring something abstract. Abstract is a tier that's been put between an interface and a class, but I couldn't see the exact reason for it.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Jan 28, 2006
Thanks for the link. I got some useful information there 'n further links for more info.