Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6257e7f

Browse files
authored
Update README.MD
1 parent b1856a3 commit 6257e7f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Multithreading/README.MD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,21 @@ class TL<T> {
577577
}
578578
}
579579
```
580+
```java
581+
public class Demo1 {
582+
@Test
583+
public void fun1() {
584+
final ThreadLocal<String> tl = new ThreadLocal<String>();
585+
tl.set("hello");//
586+
new Thread() {
587+
public void run() {
588+
tl.set("内部类存");
589+
System.out.println("内部类:" + tl.get());//null,取不出来
590+
}
591+
}.start();
592+
System.out.println(tl.get());//
593+
}
594+
```
580595

581596
## 练 习
582597
### [练习1](#答案1)

0 commit comments

Comments
 (0)