//6.4ʵ6.2еĽӿShape2D
interface Shape2D          //ӿShape2D
{
		final double pi=3.14;            //ݳԱһҪʼ
public double getArea();         //󷽷
}
class Circle implements Shape2D          
{
		double r;
		public Circle(double r)
		{
			this.r=r;
}
public double getArea()         //ʵֳ󷽷
{
	return (pi*r*r);
}
}
class Rectangle implements Shape2D          
{
		double w,h;
		public Rectangle(double width, double height)
		{
			w=width;
			h=height;
		}
public double getArea()         //ʵֳ󷽷
{
	return (w*h);
}
}
//£
public class Interface_test
{
		public static void main(String args[])
		{
			Circle ovel=new Circle(2.0);
			System.out.println("ԲovelΪ"+ovel.getArea());
			Rectangle rect=new Rectangle(2.0,3.0);
			System.out.println("rectΪ"+rect.getArea());
}
}
