mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-11 03:13:38 +00:00
21 lines
370 B
Java
21 lines
370 B
Java
class SynchronizedName {
|
|
private Object read = new Object();
|
|
private static Object READ = new Object();
|
|
|
|
void test1() {
|
|
synchronized (this.read) {
|
|
System.out.println("one");
|
|
}
|
|
}
|
|
void test4() {
|
|
synchronized (SynchronizedName.READ) {
|
|
System.out.println("four");
|
|
}
|
|
}
|
|
void test5() {
|
|
synchronized (this.read) {
|
|
System.out.println("five");
|
|
}
|
|
}
|
|
}
|