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