爱问知识人 爱问教育 医院库

用java程序计算 圆面积

首页

用java程序计算 圆面积


        

提交回答
好评回答
  • 2005-12-05 15:22:00
      //测试通过,PI怎么时3。15169的?interface Shape{  final double PI = 3。15169;  double getArea();}class Circle implements Shape{  private double radius;  public Circle(double r) {this。
      radius = r;} public double getRadius() {return this。radius;} public void setRadius(double r) {this。
      radius = r;} public double getArea() { return radius * radius * PI; }}public class Test { public static void main(String[] args) { Circle c = new Circle(3); intln("Area is " + tArea()); }}。

    g***

    2005-12-05 15:22:00

其他答案

    2005-12-05 20:47:00
  • class Round{ double radius ; final double PI= 3.15169; Round(double radius) {  this.radius=radius; } public double getArea() {  return radius * radius * PI; }}public class TestRound { public static void main(String[] args) {  Round round=new Round(3);     intln("Area is " +  tArea()); }}

    d***

    2005-12-05 20:47:00

类似问题

换一换

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):