publicclassRectangle
{
privatedoublewidth;
privatedoublelength;
publicdoublegetWidth()
{
returnwidth;
}
publicvoidsetWidth(doublewidth)
{
this.width=width;
}
publicdoublegetLength()
{
returnlength;
}
publicvoidsetLength(doublelength)
{
this.length=length;
}
publicdoublemianji()
{
returnwidth*length;
}
publicdoublezhouchang()
{
return(width+length)*2;
}
}
publicclassCircle
{
privatedoubler;
publicdoublegetR()
{
returnr;
}
publicvoidsetR(doubler)
{
this.r=r;
}
publicdoublezhouchang()
{
return2*Math.PI*r;
}
publicdoublemianji()
{
returnMath.PI*r*r;
}
}