Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Shape {
- protected double area;
- protected int perimeter;
- Point Center;
- public Shape(){ // Just sets the center for the shape
- //have to create a point object first
- Center = new Point(0,0);
- //Center.setX(0);
- //Center.setY(0);
- }
- public Shape(int x, int y){ // sets the center for the shape with the user input for the points
- //have to create a point object first
- Center = new Point(x, y);
- //Center.setX(x);
- //Center.setY(y);
- }
- abstract double calculateArea();
- @Override
- public String toString() {
- return "The Center of shape is at: ( " + Center.getX() + ", " + Center.getY() + " )";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement