Passing class as argument to a method
<p>I'm doing the following to establish the public methods of the class TestA.</p>

<pre><code>List&lt;String&gt; strings = new ArrayList&lt;String&gt;();
Method[] methods = TestA.class.getDeclaredMethods();
for(Method method : methods) 
{
  if(Modifier.isPublic(method.getModifiers())) 
  {         
    strings.add(method.getName());
  }
}
</code></pre>

<p>I also need to do the same thing for <code>TestB</code>, <code>TestC</code> etc so I'd like to have a function which takes a class name and returns a String array of the public methods. How can I do this?</p>

<p>If I have an Object parameter, I will have to create an instance of each Class before I send them to the function. I wish to avoid this.</p>
