About java.util.concurrent AtomicInteger <p>I came across source code of AtomicInteger class on <a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8u40-b25/java/util/concurrent/atomic/AtomicInteger.java/" rel="nofollow">GrepCode</a> and found following code snippet.</p> <pre><code> static { try { valueOffset = unsafe.objectFieldOffset (AtomicInteger.class.getDeclaredField("value")); } catch (Exception ex) { throw new Error(ex); } } private volatile int value; </code></pre> <p>How the static block know the offset of instance variable value . Static initialise when class is loaded and linked . so how can we know about the offset of the instance value at class loading time . Object are created after class loaded . Is that "value" instance variable will have fixed offset when ever object is created. Please explain . </p>