title: Java and inherited static members
body: <p>Suppose i have the below class:</p>
  
  <pre><code>class Parent
  {
      private int ID;
      private static int curID = 0;
  
      Parent()
      {
           ID = curID;
           curID++;
      }
  }
  </code></pre>
  
  <p>and these two subclasses:</p>
  
  <pre><code>class Sub1 extends Parent
  {
      //...
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Sub2 extends Parent
  {
      //...
  }
  </code></pre>
  
  <p>My problem is that these two subclasses are sharing the same static curID member from
   parent class, instead of having different ones.</p>
  
  <p>So if i do this:</p>
  
  <pre><code>{
      Sub1 r1 = new Sub1(), r2 = new Sub1(), r3 = new Sub1();
      Sub2 t1 = new Sub2(), t2 = new Sub2(), t3 = new Sub2();
  }
  </code></pre>
  
  <p>ID's of r1,r2,r3 will be 0,1,2 and of t1,t2,t3 will be 3,4,5.
  Instead of these i want t1,t2,t3 to have the values 0,1,2, ie use another copy of curID static variable.</p>
  
  <p>Is this possible? And how? </p>