title: using method from enum class, when the enum is obtained during runtime
body: <p>I have a class </p>
  
  <pre><code>public class AT{
      public Map getMap(){
          Map&lt;String,Class&gt; map = new HashMap&lt;&gt;(); 
          map.put("name",AT.A.class); 
          map.put("name",AT.B.class);
          return map;
      }
  
      public enum A {;
          a,b,c,d;
          public static String getTableName() {
              return "table_nameA" ;
          }
      }
      public enum B {;
          e,f,g,h;
          public static String getTableName() {
              return "table_nameB" ;
          }
      }
  }
  </code></pre>
  
  <p>I will get a string <code>s</code> from user from which can be use to get enum class <code>A</code> from the <code>map</code>.</p>
  
  <p>Main class -></p>
  
  <pre><code>AT at = new AT();
  Map&lt;String,Class &gt; map = new HashMap&lt;&gt;(at.getMap());
  System.out.println(map.get(s).getEnumConstants()[0]);  //will give a;
  </code></pre>
  
  <p>But I am not able to access the function <code>getTableName</code></p>
  
  <pre><code>System.out.println( map.get(s).getTableName() ); //want to use this but doesn't work.
  </code></pre>