title: Dynamic variable names Java
body: <p>How will I be able to retrieve the value of a variable which has a dynamic name</p>
  
  <p>For Example I have list of constants</p>
  
  <pre><code>public class Constant{
      public static final String S_R = "Standard(240)";
      public static final String S_W = "Standard(180)";
      public static final String L_R = "Large(360)";
      public static final String L_W = "Large(280)";
  }
  </code></pre>
  
  <p>Based on database I build a variable name </p>
  
  <pre><code>String varName = "S" + "_"  +"R"; // This can be S_R , S_W , L_R or L_W
  String varVal = // How do i get value of S_R
  </code></pre>