/**
* @author beanlam
* @version 1.0
* @date 2018/9/12
*/
public class Monitor {
private Object ANOTHER_LOCK = new Object();
private synchronized void fun1() {
}
public static synchronized void fun2() {
}
public void fun3() {
synchronized (this) {
}
}
public void fun4() {
synchronized (ANOTHER_LOCK) {
}
}
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |