forked from john-bai/DesignPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrototype.java
More file actions
36 lines (32 loc) · 706 Bytes
/
Copy pathPrototype.java
File metadata and controls
36 lines (32 loc) · 706 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
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package designpatterns;
/**
*
* @author jtherrell
*/
class House implements Cloneable {
private int numOfDoors;
private int numOfWindows;
private int numOfStories;
public House(int doorsNum, int windowsNum, int storiesNum) {
numOfDoors = doorsNum;
numOfWindows = windowsNum;
numOfStories = storiesNum;
}
public void numOfDoors(int num) {
numOfDoors = num;
}
public void numOfWindows(int num) {
numOfWindows = num;
}
public void numOfStories(int num) {
numOfStories = num;
}
@Override
protected House clone() {
return new House(numOfDoors, numOfWindows, numOfStories);
}
}