今天Tony来和大家聊聊Java中关键字volatile. 字节码 首先volatile int a = 3;和int a = 3;, 加不加volatile关键字,最终生成的字节码都一样的.有兴趣的同学可以试试看看字节码是否一样. 英文解释 Adding volatile to the field does not change Java bytecode that reads or writes the field. It only changes the interpretation of…