Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3. public class CircleManager
  4. {
  5. private ArrayList<Circle> circle;
  6.  
  7. public CircleManager()
  8. {
  9. circle = new ArrayList<Circle>();
  10. }
  11.  
  12. public void add(Circle c)
  13. {
  14. circle.add(c);
  15. }
  16.  
  17. public int getCount()
  18. {
  19. int count = circle.size();
  20. return count;
  21. }
  22.  
  23. public Circle getLargest()
  24. {
  25. double largest = circle.get(0).getRadius();
  26. for (int i = 1; i < circle.size(); i++)
  27. {
  28. if (circle.get(i).getRadius() > largest)
  29. {
  30. largest = circle.get(i).getRadius();
  31. }
  32. }
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement