Class Colored Circle Java Exercise - Java Programming Course

 Exercise

Class Colored Circle

 Objetive

Expand the exercise (shapes + square), so that it can also store data about "Colored Circles":

 Example Code

package shapes;
public class ColoredCircle extends Circle
{
	protected int color;
	public ColoredCircle()
	{

	}
	public ColoredCircle(double dX, double dY, double dRadius, int color)
	{
		this.dX = dX;
		this.dY = dY;
		this.dRadius = dRadius;
		this.color = color;
	}

	public final void Move()
	{

	}

	public final void Scale()
	{

	}

	public final String toString()
	{
		return "";
	}

	public final int GetColor()
	{
		return 0;
	}

	public final void SetColor(int newColor)
	{
		color = newColor;
	}

	@Override
	public double Area()
	{
		return 0;
	}
	@Override
	public double Perimeter()
	{
		return 0;
	}
}


Juan A. Ripoll - Programming Tutorials and Courses © 2024 All rights reserved.  Legal Conditions.