Advertisement
QwarkDev

lab2 / java

Sep 2nd, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1.  
  2. package com.company;
  3.  
  4. public class Circle
  5. {
  6. private int radius;
  7. private String color;
  8.  
  9. public void setRadius(int radius)
  10. {
  11. this.radius = radius;
  12. }
  13.  
  14. public int getRadius()
  15. {
  16. return radius;
  17. }
  18.  
  19. public void setColor(String color)
  20. {
  21. this.color = color ;
  22. }
  23.  
  24. public String getColor()
  25. {
  26. return color;
  27. }
  28.  
  29. public String toString()
  30. {
  31. return String.format("Circle Info: radius=%d, color=%s", getRadius(), getColor());
  32. }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement