Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Circle{
- private float radius = 1.0;
- private String color = "red";
- public float getRadius()
- {
- return this.radius;
- }
- public Circle(float radius)
- {
- this.radius = radius;
- }
- public Circle(String color)
- {
- this.color = color;
- }
- public float getArea()
- {
- float pi = 3.1415;
- return this.radius * this.radius * pi;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement