Skip to content

Commit 25f460b

Browse files
committed
step 2: monitored memory loss
1 parent 45fc339 commit 25f460b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/com/premaseem/Calculator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
@link: https://premaseem.wordpress.com/category/computers/design-patterns/
77
*/
88
public class Calculator {
9-
9+
static int num = 0;
10+
public Calculator(){
11+
num++;
12+
System.out.println(num+ " wasting memory with new object");
13+
}
1014
public Integer add(Integer sum, Integer number){
1115
return sum + number;
1216
}

0 commit comments

Comments
 (0)