Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Circle {
- double radius = 1.0;
- public Circle() {
- }
- public Circle(double radius) {
- this.radius = radius;
- }
- public double getRadius() {
- return this.radius;
- }
- public void setRadius(double radius) {
- this.radius = radius;
- }
- public double getArea() {
- return Math.PI * this.radius * this.radius;
- }
- public double getCircumference() {
- return 2 * Math.PI * this.radius;
- }
- public String toString() {
- return "Circle[radius=" + this.radius + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement