title: Why reflection invoke method require varargs to be wrapped in array?
body: <p>Answering <a href="https://stackoverflow.com/questions/17092844/nosuchmethodfound-exception">this other question</a> on S.O. , I got this strange problem that I cannot understand. Why reflection 'invoke' method of Method class require varargs argument to be wrapped in an array in order to work?</p>
  
  <p>Other classes methods with vararg arguments runs fine just calling them the normal way... </p>
  
  <pre><code>public class Main {
     public static void main(String[] args){
  
  
      try {
          Class&lt;?&gt; p = Main.class;
  
          String[] arguments1 = {"ciao"};
          String[] arguments2 = {"salve"};
          String[] arguments3 = {"buonasera"};
  
          Method m = p.getDeclaredMethod("showIt",String[].class);
  
  
          //this is ok
          showIt(arguments1);
  
          //this is ok
          m.invoke(null, new Object[]{arguments2});
  
          //this throws IllegalArgumentException!!
          m.invoke(null, arguments3);
  
      } catch (Exception e) {
          e.printStackTrace();
      }
    }
  
    public static void showIt(String[] result) {
      System.out.println(result[0]);
    }
  
  
  }
  </code></pre>
  
  <p>What is special in invoke method?</p>