Class Colored Circle Learn programming Java

Lesson:

OOP Object Oriented Programming


Exercise:

Class Colored Circle


Objetive:

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


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 - Systems Tutorials and Programming Courses ©  All rights reserved.  Legal Conditions.