title: Why I am able to re-create java.lang package and classes?
body: <p>I am just playing with package structure. And to my surprise I can bypass the default classes by creating my package and class name with that name.</p>
  
  <p>For ex: </p>
  
  <p>I created a package called <code>java.lang</code> and Class is <code>Boolean</code>. When I import <code>java.lang.Boolean</code> it's not the JDK's version of <code>Boolean</code>. It's mine. It's just showing the methods of <code>Objects</code> which every object java have.</p>
  
  <p>Why so ? Why I am allowed to create the package <code>java.lang</code>? And the program runs fine. </p>
  
  <p><a href="https://i.stack.imgur.com/l3eIH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/l3eIH.png" alt="enter image description here"></a></p>
  
  <p>Another baffle is if I create a <code>Class</code> with name <code>Object</code> and try to runs the program then an exception </p>
  
  <pre class="lang-none prettyprint-override"><code>java.lang.SecurityException: Prohibited package name: java.lang
      at java.lang.ClassLoader.preDefineClass(Unknown Source)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
  </code></pre>
  
  <p>Why is this behaviour ? is this a bug or normal behaviour ?</p>