previous | start | next

## Abstract Classes

- Factor out common behavior
  (setSelected, isSelected)
- Subclasses inherit common behavior
- Some methods still undefined
  (draw, drawSelection, translate, contains)

    public class SelectableShape implements Item

    {

       public void setSelected(boolean b) { selected = b; }

       public boolean isSelected() { return selected; }

       private boolean selected;

    }

previous | start | next