Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ShapeTester {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Shape[] shapes = new Shape[8];
- Point [] points = new Point[4];
- Point p1 = new Point(0,4);
- Point p2 = new Point(3,4);
- Point p3 = new Point(3,0);
- Point p4 = new Point();
- points[0] = p1;
- points[1] = p2;
- points[2] = p3;
- points[3] = p4;
- /*
- for(Point p : points) {
- System.out.println(p);
- }
- */
- //Rectangle r1 = new Rectangle(p1, p2, p3, p4);
- Shape r1 = new Rectangle(p1, p2, p3, p4);
- System.out.println("Distance between p1 & p2: " + r1.distanceFormula(p2, p3));
- System.out.println(r1);
- System.out.println();
- Circle c1 = new Circle(3, 4, 5);
- System.out.println(c1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement