How to Access Variable's Memory Address In Java? : <p>I wrote this code and want to see memory location of 2 objects that i create from one class and make instance of one specific variable.</p>

<pre><code>public class StaticFields {

    int a = 12;
    int b = 235;

    public static void main(String[] args) {
      StaticFields obj = new StaticFields();

      int a = obj.a;

      StaticFields obj2 = new StaticFields();

      int c = obj2.a;

       System.out.println(System.identityHashCode(a));
       System.out.println(System.identityHashCode(c));

    }
}


</code></pre>

<p>why the "identityHashCode" of "a" and "c" is the same ?</p>

<p>Thanks.</p>
