title: IllegalArgumentException: wrong number of arguments in Java Constructor.newInstance()
body: <p>Consider the following code, </p>
  
  <pre><code>public class StartUp {
  
      public StartUp(String[] test){}
  
      public static void main(String[] args) throws Exception{
          Constructor cd = StartUp.class.getConstructor(String[].class);
          System.out.println(cd.newInstance(new String[]{}).toString());
      }
  }
  </code></pre>
  
  <p>What's wrong with it? I get the following Exception: </p>
  
  <blockquote>
    <p>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 com.test.StartUp.main(StartUp.java:10)</p>
  </blockquote>