Unsafe对象

4. Unsafe对象

1.code image1
unsafe 直接操作底层硬件(内存等), 程序员不建议操作, 故名unsafe
只能通过反射获得 image2
unsafe的cas操作

image3

利用unsafe类对引用对象进行操作

实现原子整数类