mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update java-concurrent-questions-02.md
This commit is contained in:
parent
2a0057a189
commit
72f91281a5
@ -515,7 +515,7 @@ JDK 提供的所有现成的 `Lock` 实现类,包括 `synchronized` 关键字
|
||||
在下面的代码中,`method1()` 和 `method2()`都被 `synchronized` 关键字修饰,`method1()`调用了`method2()`。
|
||||
|
||||
```java
|
||||
public class ReentrantLockDemo {
|
||||
public class SynchronizedDemo {
|
||||
public synchronized void method1() {
|
||||
System.out.println("方法1");
|
||||
method2();
|
||||
|
Loading…
x
Reference in New Issue
Block a user