abstract class MouseAdapter vs. interface
- by Stefano Borini
I noted this (it's a java.awt.event class).
public abstract class MouseAdapter implements MouseListener,
MouseWheelListener,
MouseMotionListener {
....
}
Then you are clearly forced to extend from this adapter
public class MouseAdapterImpl extends MouseAdapter {}
the class is abstract and implements no methods. Is this a strategy to combine different interfaces into a single "basically interface" ? I assume in java it's not possible to combine different interfaces into a single one without using this approach.
In other words, it's not possible to do something like this in java
public interface MouseAdapterIface extends MouseListener,
MouseWheelListener,
MouseMotionListener {
}
and then eventually
public class MouseAdapterImpl implements MouseAdapterIface {}
Is my understanding of the point correct ? what about C# ?