Course Solutions Uncategorized (Solved) : Java Geometricobjectjava Abstract Geometricobject Class Public Abstract Class Geometricobj Q27195060 . . . .

(Solved) : Java Geometricobjectjava Abstract Geometricobject Class Public Abstract Class Geometricobj Q27195060 . . . .

 

JAVA

// GeometricObject.java: The abstract GeometricObject class

public abstract class GeometricObject {

private String color = “white”;

private boolean filled;

/**Default construct*/

protected GeometricObject() {

}

/**Construct a geometric object*/

protected GeometricObject(String color, boolean filled) {

this.color = color;

this.filled = filled;

}

/**Getter method for color*/

public String getColor() {

return color;

}

/**Setter method for color*/

public void setColor(String color) {

this.color = color;

}

/**Getter method for filled. Since filled is boolean,

so, the get method name is isFilled*/

public boolean isFilled() {

return filled;

}

/**Setter method for filled*/

public void setFilled(boolean filled) {

this.filled = filled;

}

/**Abstract method findArea*/

public abstract double getArea();

/**Abstract method getPerimeter*/

public abstract double getPerimeter();

}

13.1 (Triangle class) Design a new Triangle class that extends the abstract GeometricObject class.

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post