title: How can I force subclasses to redefine a constant in Java?
body: <p>How can I have a generic abstract class, let's say Animal, and have it implement a constant (or a variable; it doesn't mind) which must be redefined by all subclasses?</p>
  
  <p>Example:</p>
  
  <pre><code>abstract class Animal {
      private static int venerableAge;
  }
  </code></pre>
  
  <p>And force <code>Dog</code> to be defined something like</p>
  
  <pre><code>class Dog extends Animal {
      private static int venerableAge = 10;
  }
  </code></pre>
  
  <p><strong>I don't want</strong> different subclasses to be able to <strong>read nor write</strong> each others' value. Just the one of themselves.</p>
  
  <p>I.e., each class must have its own static "instance" of the variable. And no one will access the parent's.</p>
  
  <p>Is that possible in Java?</p>