正在加载图片...
Classes class circle /* The radius of this circle * double radius =1.07 Data field 大大 Construct a ciro1 e object* Circle i Constructors 大大 Construct a circle object Circle(double newRadius)[ radius newRadiusi /大大 Return the area of this circle+/ double getArea()I Method return radius radius * 3.1415913 Classes class Circle { /** The radius of this circle */ double radius = 1.0; /** Construct a circle object */ Circle() { } /** Construct a circle object */ Circle(double newRadius) { radius = newRadius; } /** Return the area of this circle */ double getArea() { return radius * radius * 3.14159; } } Data field Method Constructors
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有