On 29 Jul, 02:56, Lew <com.lewscanon@lew> wrote:
An abstract class
* may have implementation.
So what's an abstract class for? If you want an interface, use an
interface; if you want to attach implementation, consider an abstract
class.
Both of these are viable approaches, but they're not exclusive (as is
too often thought). There's nothing that says "If you want an
interface with a bit of implementation too, then use an abstract class
_instead_of_ an interface".
If you are in this case, consider using _both_ instead. Define the
interface with an interface (that's what they're good for) and then
write an abstract class that implements this interface and attaches
the implementation that you need.