Skip to content

Commit 0ea59f5

Browse files
committed
add object combination
1 parent 0933f28 commit 0ea59f5

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

.idea/compiler.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.yiyun;
2+
3+
import lombok.AllArgsConstructor;
4+
5+
@AllArgsConstructor
6+
public class SafePoint {
7+
8+
private int x,y;
9+
private SafePoint(int [] a){
10+
this(a[0],a[1]);
11+
}
12+
public SafePoint(SafePoint point){
13+
this(point.get());
14+
}
15+
public synchronized int[] get() {
16+
return new int[]{x,y};
17+
}
18+
public synchronized void set(int x,int y){
19+
this.x=x;
20+
this.y=y;
21+
}
22+
}

0 commit comments

Comments
 (0)