01
02
03
04
05
06
07
08
09
10
11
12
13
package factory.shape3;
import java.awt.Graphics;
public interface Shape {
  void paint(Graphics g);
}
class Ellipse implements Shape {
  public void paint(Graphics g) { /* ... */ }
  // ...
}
class Rectangle implements Shape {
  public void paint(Graphics g) { /* ... */ }
  // ...
}