Skip to content

Commit b0ffbcf

Browse files
author
Ben Keller
committed
Add math.Int input class
1 parent 891f0c1 commit b0ffbcf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main/java/math/Int.java

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package math;
2+
3+
public class Int {
4+
5+
private final int value;
6+
7+
public String toString() {
8+
return Integer.toString(value);
9+
}
10+
11+
private Int() {
12+
this.value = 0;
13+
}
14+
15+
public Int(int value) {
16+
this.value = value;
17+
}
18+
19+
public Int add(Int other) {
20+
return new Int(this.value + other.value);
21+
}
22+
23+
}

0 commit comments

Comments
 (0)