Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. class Circle{
  2. private float radius = 1.0;
  3. private String color = "red";
  4. public float getRadius()
  5. {
  6. return this.radius;
  7. }
  8. public Circle(float radius)
  9. {
  10. this.radius = radius;
  11. }
  12. public Circle(String color)
  13. {
  14. this.color = color;
  15. }
  16. public float getArea()
  17. {
  18. float pi = 3.1415;
  19. return this.radius * this.radius * pi;
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement