-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.java
More file actions
55 lines (43 loc) · 1.06 KB
/
Copy pathShape.java
File metadata and controls
55 lines (43 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package Homework1;
import java.lang.*;
import java.math.*;
public abstract class Shape {
public String color;
public boolean filled;
public Shape(String color, boolean filled) {
this.color = color;
this.filled = filled;
}
public Shape(String color) {
this.color = color;
}
public Shape(boolean filled) {
this.filled = filled;
}
protected Shape() {
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Boolean getFilled() {
return filled;
}
public void setFilled(boolean filled) {
this.filled = filled;
}
public abstract double getArea();
public abstract double getPerimeter();
@Override
public String toString() {
return "Shape{" +
"color='" + color + '\'' +
", filled=" + filled +
'}';
}
public boolean isFilled() {
return false;
}
}