import javax.swing.JApplet;
import java.awt.Graphics;
import java.util.ArrayList;

public class Driver0 extends JApplet {
  private static final long serialVersionUID = 1L;
  private ArrayList<Shape> figures;

  public void init() {
    figures = new ArrayList<Shape>();
    Shape s1 = new Circle(20, 20, 10);
    figures.add(s1);
    Shape s3 = new Circle(30, 30, 10);
    figures.add(s3);
    Shape s4 = new Rectangle(40, 50, 10, 20);
    figures.add(s4);
  }

  public void paint(Graphics g) {
    g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
    for (Shape s : figures) {
      s.draw(g);
    }
  }
}
