title: JavaCompiler didn't catch error on redefinition of a Java class.
body: <p>During my Java learning, I tried this piece of code which compiled &amp; ran successfully. Can anybody please provide an explanation that why hasn't the compiler generated any error? I imported the complete package which includes java.util>Scanner as well, so shouldn't there be an error that the Scanner is already defined in util package &amp; I'm trying to redefine it here?</p>
  
  <pre><code>import java.util.*;
  
  class Scanner
  {
      public static void main(String... args)
      {
          Scanner c = new Scanner();
      }
  }
  </code></pre>
  
  <p>My Java basics are not very clear so kindly bear if this appears to be completely a noob's question and there was no question alike on this forum so I thought to better ask it.</p>