-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.java
More file actions
41 lines (31 loc) · 671 Bytes
/
Shape.java
File metadata and controls
41 lines (31 loc) · 671 Bytes
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
package prototype_pattern;
/**
* @ClassName Shape
* @Description TODO
* @Author qulingxiao
* @Date 2020/7/12 8:34
* @Version 1.0
*/
public abstract class Shape implements Cloneable{
private String id;
public String type;
abstract void draw();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public Object clone() {
Object clone = null;
try {
clone = super.clone();
}catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return clone;
}
}