Class Shapes Learn programming Java

Lesson:

Object Oriented Programming


Exercise:

Class Shapes 15


Objetive:

Using Visual Studio, create a project and the corresponding classes (using several files) for this classes diagram.


Code:

package shapes;
public class Circle extends Shape
{
	protected double radius;
}

package shapes;
public class Location
{
	private double x, y;
}

package shapes;
public class Rectangle extends Shape
{
	protected double side1, side2;
}

package shapes;
public class Shape
{
	protected Location c;

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

	public final double Area()
	{
		return 0.000;
	}

	public final double Perimeter()
	{
		return 0.000;
	}
}

package shapes;
public class Main
{
	static void main(String[] args)
	{

	}
}