Why can I create more than one instance of a singleton with reflection?
<p>Why java doesn't stop you to instantiate any singleton class object?</p>

<p>I was trying to create object of Void class</p>

<pre><code>java.lang.Void
</code></pre>

<p>I wrote this code to create two instance </p>

<pre><code>try{
    Class clazz = Void.class;
    Constructor cons = clazz.getDeclaredConstructor();
    cons.setAccessible(true);
    Void s2 = (Void) cons.newInstance(); 
    System.out.println(s2);
    Void s3 = (Void) cons.newInstance(); 
    System.out.println(s3);

}catch (Exception e) {
    e.printStackTrace();
} 
</code></pre>

<p>Can anybody explain - why this is allowed in java?</p>
