Skip to content

Commit 2da4989

Browse files
committed
✨ Introducing new features. volatile
1 parent 26533ee commit 2da4989

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

MD/concurrent/volatile.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 你应该知道的 volatile
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.crossoverjie.basic;
2+
3+
import java.lang.reflect.Field;
4+
5+
/**
6+
* Function:
7+
*
8+
* @author crossoverJie
9+
* Date: 08/03/2018 13:56
10+
* @since JDK 1.8
11+
*/
12+
public class StringTest {
13+
14+
public static void main(String[] args) throws NoSuchFieldException {
15+
String a = "123";
16+
System.out.println("a=" + a);
17+
18+
a = "456";
19+
System.out.println("a=" + a);
20+
21+
Field value = a.getClass().getField("value");
22+
}
23+
}

0 commit comments

Comments
 (0)