System.out.println(redius*redius*PI);
}
}
class Res implements Shape
{
private int width;
private int len;
Res(int width,int len) //throws AreasException
{
if(width<0||len<0)
throw new AreasException("长度未付");
this.width=width;
this.len=len;
}
public void areas()
{
System.out.println(width*len);
}
}
/*
class FuShuException extends RuntimeException
{
FuShuException(String msg)
{
super(msg);
}
}
class Demo
{
public int div(int a,int b) //throws ArithmeticException
{
if(b<0)
throw new FuShuException("。。。。除数为负了");
if(b==0)
throw new ArithmeticException("除数是零了");// 换成new Exception("除数是零了");
return a/b;
}
}*/
class RuntimeExceptionDemo
{
public static void main(String[] args) //throws AreasException
{
Circle c=new Circle(-20);
c.areas();