Square Class

As well as a circle, we could define a square.

Square Class

As well as a circle, we could define a square.

Square Class

As well as a circle, we could define a square.

Square Class

As well as a circle, we could define a square.

Square Class

As well as a circle, we could define a square.

Square Class

Finished code.

class Circle {
private int x=50, y=50;
private int size=20;

public void moveTo(int xpos, int ypos){
	x=xpos; y=ypos;
	}

public void draw(java.awt.Graphics g){
	g.drawOval(x, y, size, size);
	}

}

class Circle {
private int x=50, y=50;
private int size=20;

public void moveTo(int xpos, int ypos){
	x=xpos; y=ypos;
	}

public void draw(java.awt.Graphics g){
	g.drawOval(x, y, size, size);
	}

}

class Square {
private int x=50, y=50;
private int size=20;

public void moveTo(int xpos, int ypos){
	x=xpos; y=ypos;
	}

public void draw(java.awt.Graphics g){
	g.drawOval(x, y, size, size);
	}

}

class Square {
private int x=50, y=50;
private int size=20;

public void moveTo(int xpos, int ypos){
	x=xpos; y=ypos;
	}

public void draw(java.awt.Graphics g){
	g.drawOval(x, y, size, size);
	}

}

class Square {
private int x=50, y=50;
private int size=20;

public void moveTo(int xpos, int ypos){
	x=xpos; y=ypos;
	}

public void draw(java.awt.Graphics g){
	g.drawRect(x, y, size, size);
	}

}

class Square {
private int x=50, y=50;
private int size=20;

public void moveTo(int xpos, int ypos){
	x=xpos; y=ypos;
	}

public void draw(java.awt.Graphics g){
	g.drawRect(x, y, size, size);
	}

}