How does java compiler know of genrics type information of a code in jar?
<p>I have a quetion regrading the java generics.
As I know,generic information is only available at compile time , through a process called "type erasure" all TYPE information 
goes away once the code is compiled and .class file is made </p>

<p>that is once .java file is compiled ,  List myList = new arrayList(), is what the .class file bytecode have, even though the list is declared as list of strings in .java file.</p>

<p>Having said that, consider below scenario.</p>

<p>I have a jar with a method with signature </p>

<pre><code>public void check(List&lt;String&gt; p)
</code></pre>

<p>When I call this method from another code , the compiler enforces that the argument to check method should be <code>List&lt;String&gt;</code> only, nothing else.</p>

<p>Now since the check method exists in jar (.class files), how does compiler know about TYPE information required for <code>List&lt;String&gt;</code>, if TYPE information 
is already REMOVED when .class file is made ?</p>
