title: reflection in java with method parameters
body: <p>i want to do do a simple reflection with java </p>
  
  <p>i want use multiple parameters with the methods?</p>
  
  <p>my class</p>
  
  <pre><code>package reflection;
  
  import java.util.Date;
  
  public class SimpleClass {
  
      public Date datum1() {
          Date d = new Date();
          return d;
      }
  
      public Object datum2(String str) { 
          Date d = new Date();    
          return d;
      }
  
  }
  </code></pre>
  
  <p>my test</p>
  
  <pre><code>package reflection;
  
  import java.lang.reflect.Method;
  
  public class ReflectionTest {
  
      public Object getMethodProperty(Object object, String... args) {
  
          Object value = null;
  
          try {
              Method m = object.getClass().getMethod(args[0], new Class[] {});
              value = m.invoke(object, new Object[] {});
          } catch (Exception e) {}
          return value;
      }
  
      public static void main(String[] args) {
  
          Reflection r = new Reflection();
          SimpleClass s = new SimpleClass();
  
          System.out.println(r.getMethodProperty(s, "datum1", "test"));
          System.out.println(r.getMethodProperty(s, "datum2", "test"));
      }
  
  
  }
  </code></pre>
  
  <p>the first result is the actual date</p>
  
  <p>the second result is null</p>
  
  <p>how can i use parameters for the methods?</p>
  
  <p>thanks icke</p>