skity

tester

Nov 28th, 2020
594
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Tester {
  2.     public static void main(String[] args) {
  3.         Circle c1 = new Circle();
  4.         Circle c2 = new Circle(c1);
  5.         Circle c3 = new Circle();
  6.        
  7.         System.out.println(c1.getCenter());
  8.         System.out.println(c1.getRadius());
  9.        
  10.         Point p = new Point(1, 2);
  11.         c2.setCenter(p);
  12.         c2.setRadius(7);
  13.        
  14.         System.out.println(c1);
  15.         System.out.println(c2);
  16.         System.out.println(c3);
  17.        
  18.         System.out.println("Circle 1 equals circle 3?" + c1.equals(c3));
  19.         System.out.println("Circle 2 equals circle 3?" + c2.equals(c3));
  20.        
  21.         System.out.println("Circle c1 area: " + c1.area());
  22.         System.out.println("Circle c2 perimeter: " + c2.perimeter());
  23.        
  24.         System.out.println("Circle 1 equals circle 2? " + c1.equals(c2));
  25.        
  26.         System.out.println("Circle 1 touches circle 2? " + c1.touches(c2));
  27.        
  28.         System.out.println("Circle 1 contains circle 2? " + c1.contains(c2));
  29.         System.out.println("Circle 2 contains circle 1? " + c2.contains(c1));
  30.        
  31.         System.out.println("Circle 2 intersects circle 1? " + c2.intersects(c1));
  32.        
  33.         System.out.println("Circle 1 contains point (0,0)? " + c1.contains(new Point()));
  34.        
  35.         System.out.println("Circle 2 subcircle: " + c2.subCircle());
  36.        
  37.        
  38.        
  39.    
  40.        
  41.     }
  42. }
RAW Paste Data