title: How to use father's method with son's variable in java?
body: <p>since the content of my code is very long, i'll try to keep it abstract.
  so, I have an abstract father, containing methods that are applicable for all its sons.</p>
  
  <pre><code>abstract class a {
   protected final void a_method() {
    ...do stuff
   }
  }
  </code></pre>
  
  <p>and I have another two classes that extends a</p>
  
  <pre><code>class b extends a {
    static int _int = 3;
  }
  </code></pre>
  
  <p>and also,</p>
  
  <pre><code>class c extends a {
    static int _int = 2;
  }
  </code></pre>
  
  <p>So as you see, all my b's always have the same static _int variable, and all my c's always have the same _int variable as well. 
  The method a_method() is exactly the same code for both sons, just using the son's variable.
  can I avoid the duplication of code?
  since my variable is static, I cant declare it in <code>a</code> because it needs to be different for each son's class (different content for each extending class)</p>