Created
May 11, 2019 20:25
-
-
Save katychuang/1fa1e3752c5ea9c450917b4e679909ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Circle { | |
private double radius; | |
public Circle(double radius) { | |
this.radius = radius; | |
} | |
public double getRadius() { | |
return radius; | |
} | |
public void setRadius(double radius) { | |
this.radius = radius; | |
} | |
private double calculateArea() { | |
return radius * radius * Math.PI; | |
} | |
public String toString() { | |
return "The area of the circle [radius = " + radius + "]: " + calculateArea(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment