Untitled

 avatar
unknown
java
3 years ago
771 B
4
Indexable
public class MyShape {
    private String color;
    private boolean filled;

    public MyShape() {
        color = "red";
        filled = true;
    }

    public MyShape(String color, boolean filled) {
        this.color = color;
        this.filled = filled;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public boolean isFilled() {
        return filled;
    }

    public void setFilled(boolean filled) {
        this.filled = filled;
    }

    @Override
    public String toString() {
        return "MyShape{" +
                "color='" + color + '\'' +
                ", filled=" + filled +
                '}';
    }
}
Editor is loading...