Source:

// Question 3.3
import java.applet.Applet;
import java.awt.*;

public class q33 extends Applet
{
public void paint (Graphics g)
{
int roofx[] = { 100, 150, 300, 350 };
int roofy[] = { 130, 80, 80, 130 };
int housex[] = { 120, 120, 330, 330 };
int housey[] = { 129, 230, 230, 129 };

g.setColor (Color.blue);
g.fillPolygon (roofx, roofy, 4);
g.setColor (Color.black);
g.drawPolygon (housex, housey, 4);
}
}