title: Using Java Constructor.newInstance(args) , why the "wrong number of args" error?
body: <p>Why does this fail with the error :</p>
  
  <pre><code>Args are: -normi -nosplash
  Exception in thread "main" java.lang.IllegalArgumentException: wrong 
       number of arguments
      at sun.reflect.NativeConstructorAccessorImpl
      .newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl
      .newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl
      .newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at TSStack.main(TSStack.java:14)
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>public static void main(String args[]) throws Exception {
      System.out.println("Args are: " + args[0]+ " " + args[1] );
          try {
              Constructor&lt;Site&gt; c = Site.class.getDeclaredConstructor();
              c.setAccessible(true); // use reflection to get access to  
                                        //this private constructor
              c.newInstance( (Object[])args );
            } catch (InvocationTargetException x) {
              x.printStackTrace();
            } catch (NoSuchMethodException x) {
              x.printStackTrace();
            } catch (InstantiationException x) {
              x.printStackTrace();
            } catch (IllegalAccessException x) {
              x.printStackTrace();
            }     
  }
  </code></pre>