title: Java - When a global variable is declared and initialized with a value, the what happens while object creation?
body: <p>When a global variable is declared and initialized with a value, then while creating object of the class, is the global variable again gets initialized and gets a new memory?</p>
  
  <pre><code>class A{
  
  int a = 10;
  
  }
  </code></pre>
  
  <p>This will gets stored in the memory address <code>a</code> with value <code>10</code>. But when I create object of the class A, then is the a gets initialized again?</p>
  
  <pre><code>class A{
  
  int a = 10;
  
  public static void main(String args[]){
  
  A a = new A();
  
  }
  </code></pre>