You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
719 B

7 years ago
  1. public class Shape{
  2. private boolean isFilled;
  3. private String color;
  4. public Shape() {
  5. this.isFilled = true;
  6. this.color = "Green";
  7. }
  8. public Shape(boolean isFilled,String color){
  9. this.isFilled = isFilled;
  10. this.color = color;
  11. }
  12. public void setColor(String color) {
  13. this.color = color;
  14. }
  15. public void setIsFilled(boolean isFilled){
  16. this.isFilled = isFilled;
  17. }
  18. public String getColor() {
  19. return this.color;
  20. }
  21. public boolean getIsFilled(){
  22. return this.isFilled;
  23. }
  24. public String toString() {
  25. String ret = "";
  26. ret += "Filled: "+this.isFilled + "\n";
  27. ret += "Color: "+this.color + "\n";
  28. return ret;
  29. }
  30. }