iawitm

Untitled

Dec 3rd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. package shape;
  2.  
  3. public abstract class Shape {
  4.     protected String color;
  5.     protected boolean filled;
  6.  
  7.     public Shape(){}
  8.     public Shape(String color, boolean filled){
  9.         this.color = color;
  10.         this.filled = filled;
  11.     }
  12.  
  13.     public String getColor() {
  14.         return color;
  15.     }
  16.  
  17.     public void setColor(String color) {
  18.         this.color = color;
  19.     }
  20.  
  21.     public void setFilled(boolean filled) {
  22.         this.filled = filled;
  23.     }
  24.  
  25.     public boolean isFilled() {
  26.         return filled;
  27.     }
  28.  
  29.     abstract double getArea();
  30.     abstract double getPerimetr();
  31.     abstract public String toString();
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment