instanceof with generic collection
<p>Why would the following snippet not compile ?</p>

<pre><code>if (mangoList instanceof List&lt;Mango&gt;) { System.out.println("true"); }
</code></pre>

<ul>
<li>You don't know that mangoList is a List type.  </li>
<li>The instanceof keyword only works on primitive types.  </li>
<li>You can only check the type of collections using reflection.   </li>
<li>Generic types are erased before runtime.(ans)  </li>
<li>The statement could cause mangoList to be set to an instance of a List.</li>
</ul>

<p>Which do you think is the correct answer ?</p>
