title: Java How to make "Static" variable name to be dynamic
body: <p>Suppose I have a Class Child</p>
  
  <pre><code>public class child{
    public static int age = 1;
  }
  </code></pre>
  
  <p>And I am using class child static variable age in class School   </p>
  
  <pre><code>public class school{
   int var_age;
    public school(){     //school constructor
     var_age = child.age;
   }
  }
  </code></pre>
  
  <p>Value in age of class child could be any of these below depending on some <strong>logic</strong>:</p>
  
  <pre><code>public static int age = 1;
  public static int age = 2;
  </code></pre>
  
  <p>How could i achieve this where should i apply that <strong>logic</strong>? Also it is <strong>mandatory for class school code to remain same</strong>.</p>