📜  为什么使用 volatile 关键字? - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:03.149000             🧑  作者: Mango

代码示例1
Using volatile  Keyword is yet another way (like synchronized,
atomic wrapper) of making class thread safe. Thread safe
means that a method or class instance can be used by 
multiple threads at the same time without any problem.