title: why java generics have to erase the type information?
body: <p>Java's generics would erase the type information after the source code was compiled. And i guess the "erase" is necessary because java only keep one copy of class no matter what the generic type is. So <code>List&lt;String&gt;</code> or <code>List&lt;Number&gt;</code> are simply just one List. Then I wonder if it possible that at the premise of keeping only one copy of certain class, the instance of the class stores the generic type information at the time it is created. </p>
  
  <p>For instance: 
  when we write: </p>
  
  <pre><code>List&lt;String&gt; list = new List&lt;String&gt;. 
  </code></pre>
  
  <p>the compiler create an object of List along with a String's Class Object(meaning the Object String.class) accociated with the List, so that the generic object list can check the type information at runtime using the Class Object. Is it posssible or practicable?</p>