title: Get Java Class name from generic List type
body: <p>I have a method with 1 List, generic class inside:</p>
  
  <pre><code>public static String classTypeOfList(List&lt;T&gt; list) {
      return T.getName(); //in my mind...
  }
  </code></pre>
  
  <p>The code is wrong, but you can see, what I want. If i call this method like this:</p>
  
  <pre><code>List&lt;MyObject&gt; list;
  System.out.println("the type of the list is: "+classTypeOfList(list));
  </code></pre>
  
  <p>I would like to get this result:</p>
  
  <pre><code>the type of the list is: MyObject
  </code></pre>
  
  <p>How could I get the name of a generic type class? Or if I can't get it this way, than could you show me an another option?
  Thank you!</p>