title: How to use String to reference fields in the program code
body: <p>I have a program with various ID constants like</p>
  
  <pre><code>final int MN=8;
  final int PY=58;
  final int RB=13;
  ...
  </code></pre>
  
  <p>these costants are index of elements in a matrix, for various reasons difficult to explain, will be good If I can do a method that receives two strings for example </p>
  
  <pre><code>Object getElement("MN","PY"){
      ...
  }
  </code></pre>
  
  <p>to acts like</p>
  
  <pre><code> Object o=mymatrix[MN][PY];
  </code></pre>
  
  <p>using the passed strings to reference declared fields</p>
  
  <p>Is there any way to do this accessing the fields directly (without puth them in a Map or use switch and if else condition for every field)?</p>