How to get field value in Java reflection : <p>I have following field in a class:</p>

<pre><code>private String str = "xyz";
</code></pre>

<p>How do I get the value <code>xyz</code> using the field name <em>only</em> i.e. </p>

<p>I know the name of the field is <code>str</code> and then get the assigned value. Something like:</p>

<pre><code>this.getClass().getDeclaredField("str").getValue();
</code></pre>

<p>Currently the Reflection API has <code>field.get(object)</code>.</p>
