This is what the program looks like
This is the code
import java.awt.*;
public class Faces extends java.applet.Applet
{
Face f1, f2, f3, f4, f5, f6;
public void init()
{
f1 = new Face(10, 100);
f2 = new Face(10, 200);
f3 = new Face(10, 300);
f4 = new Face(10, 400);
f5 = new Face(10, 500);
f6 = new Face(10, 600);
}
public void paint(Graphics g)
{
f1.paint(g);
f2.paint(g);
f3.paint(g);
f4.paint(g);
f5.paint(g);
f6.paint(g);
}
}
public class Face {
int x,y;
Face(int startx, int starty) {
x = startx;
y = starty;
}
public boolean paint(Graphics g) {
g.drawOval(x,y,20,20);
g.drawOval(x+5, y+5, 3, 3);
g.drawOval(x+10, y+5, 3, 3);
return true;
}
}