title: How to invoke a getter method by its name?
body: <p>I have the following bean class:</p>
  
  <pre><code>public class A{
          private String field;
  
          public String getField() {
              return field;
          }
  
          private String setField(String field) {
              this.field = field;
          }
  
      }
  </code></pre>
  
  <p>And the following class:</p>
  
  <pre><code>    public class B{
  
           public static void main(String[] args){
               A a = new A();
               //do stuff
               String f = //get a's field value
           }
      }
  </code></pre>
  
  <p>How can I get the value returned by the getter of a particular object of <code>class A</code>? Of course, I can invoke method with <code>Method.invoke(Object obj, Object... args)</code> but I wouldn't like to write <code>"get"</code> prefix manually. Is it possible to avoid that?</p>