PPT Slide
Example: add functionality without disturbing existing Shape hierarchy, e.g., make our existing Squares drawable.
public interface Drawable {
// no constructors! no default methods! just method headers!
public void drawMe (Graphics g);
public class DrawableSquare extends Square implements Drawable {
// "extends": we inherit everything that Square has - no need to
// re-write any constructors, accessors, modifiers;
// “implements”: must have code for drawMe( ) (or at least
// declare it as abstract) in order to satisfy interface requirements
public void drawMe (Graphics g) {
g.drawRect (0,0,iSideSize,iSideSize);