01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
package factory.shape4;
public class ShapeFactory {
  private ShapeFactory() {}
  static public Shape newEllipse(int radius1, int radius2) {
    return new Ellipse(radius1, radius2);
  }
  static public Shape newCircle(int radius) {
    return new Ellipse(radius, radius);
  }
  static public Shape newRectangle(int height, int width) {
    return new Rectangle(height, width);
  }
  static public Shape newSquare(int height) {
    return new Rectangle(height, height);
  }
}