title: Wrong number of arguments error when invoking a method
body: <p>I have class <code>AClass</code> and a method <code>someMethod</code> that gets an <code>Object</code> array as parameter.</p>
  
  <pre><code>public class AClass {
      public void someMethod(Object[] parameters) {
      }
  }
  </code></pre>
  
  <p>In main, when I try to invoke this method on the the object that I have created and give an object array as a parameter to this method    </p>
  
  <pre><code>Object[] parameters; // lets say this object array is null
  Class class = Class.forName("AClass");
  Object anObject = class.newInstance();
  
  Method someMethod = class.getDeclaredMethod("someMethod", parameters.getClass());
  someMethod.invoke(anObject, parameters);
  </code></pre>
  
  <p>I get "wrong number of arguments error".
  What am i missing? </p>