title: Cast type T list to object
body: <p>I have a method which takes generic T type parameters.
  <br/></p>
  
  <pre><code>public&lt;T&gt; void run(List&lt;T&gt; inputs){
   System.out.println((Student) inputs.get(0).getFirstName());
  
  }
  </code></pre>
  
  <p>I am trying to access Student class methods inside run method.</p>
  
  <p>But I am getting <strong>cannot resolve method 'getFirstName()'</strong> compilation error.</p>
  
  <p>Please help!</p>