-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyInt.pde
More file actions
51 lines (49 loc) · 924 Bytes
/
MyInt.pde
File metadata and controls
51 lines (49 loc) · 924 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
42
43
44
45
46
47
48
49
50
51
public class MyInt {
int val;
public MyInt(int num) {
this.val = num;
}
public MyInt inc() {
val++;
return this;
}
public MyInt add(int num) {
this.val+=num;
return this;
}
//public MyInt dec() {
// val--;
// return this;
//}
//public MyInt sub(int num) {
// this.val-=num;
// return this;
//}
//public MyInt add(MyInt obj) {
// this.val+=obj.val;
// return this;
//}
//public MyInt sub(MyInt obj) {
// this.val-=obj.val;
// return this;
//}
//public MyInt mul(int num) {
// this.val*=num;
// return this;
//}
//public MyInt div(int num) {
// this.val/=num;
// return this;
//}
//public MyInt mul(MyInt obj) {
// this.val*=obj.val;
// return this;
//}
//public MyInt div(MyInt obj) {
// this.val/=obj.val;
// return this;
//}
//public String toString(){
// return "" + val;
//}
}