大家帮忙看一下 是哪的错
设计一个圆类,将圆的位置(圆心坐标和半径)作为属性(提供任意圆的设置),并能计算圆的面积。import java.awt.Graphics;
import java.applet.Applet;
public class Woailihua extends Applet{
int x=0,y=0,r=80;
final double pi=3.1;
public void paint(Graphics g)
{
g.draw Oval(x,y,r1,r1);
g.drawString("area="+area(r1/2),100,40);
g.drawString(40,40);
}
double area (double r2){
return (p*r2*r2);
}
}