Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
771 B
1
Indexable
Never
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 +
                '}';
    }
}