title: How to get original class of a field declared in java class
body: <p>Here we go, suppose if  i have class Name :</p>
  
  <pre><code>class Name {
    String firstName, lastName;
    // getters and setters, etc.
  }
  
  and then Name class's object is declared somewhere in other class :
  
  class Other {
    Name name;
    // getter and setters, etc.
  }
  </code></pre>
  
  <p>Now if i do something like : </p>
  
  <pre><code>Other o = new Other();
  Field[] fields = o.getClass().getDeclaredFields();
  
  fields[0] --&gt; is 'name' the Object of 'Name' class
  </code></pre>
  
  <p>but when i say <code>field[0].getClass()</code> :</p>
  
  <p>It gives me <code>java.lang.reflect.Field</code> class object and not <strong>Name</strong> class object.</p>
  
  <p>How can i get <strong>original</strong> class object from a field like <strong>'name'</strong></p>