1
0
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:
paigeman 2023-06-08 20:52:48 +08:00 committed by GitHub
parent 2a0057a189
commit 72f91281a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();