Java getConstructor() method
<pre><code>import java.util.*;
import java.text.*;
import java.lang.reflect.*;

public class Test {
String name;
public Test()
{
System.out.println("In Construtor");
}
public Test(String name)
{
this.name=name;
System.out.println("In Construtor paramitarized-----"+name);
}

public int q() {
    System.out.println("working");
    return 1;

}
public static void main(String args[] ) throws Exception {
    Class c=Class.forName("Test");
    Test t=(Test)c.newInstance();
    t.q();
    Constructor cons[]=c.getConstructors();
    for(Constructor ci:cons)
    ci.newInstance();
    Constructor&lt;?&gt; pcon=c.getConstructor(String.class);
    pcon.newInstance();
    System.out.println(Test.class.getName());
    }
}
</code></pre>

<p>I was just trying grasp the concepts of Class and ClassLoader Classes.
Now for this line <code>Constructor&lt;?&gt; pcon=c.getConstructor(String.class);</code> its showing that IllegalArgumentException: why?</p>

<p>Thank you Jon Skeet :) I changed my code with this and its working</p>

<pre><code>Class c=Class.forName("Test");
        Test t=(Test)c.newInstance();
        t.q();


        Constructor&lt;?&gt; pcon=c.getConstructor(String.class);
        pcon.newInstance("arijit");
        System.out.println(Test.class.getName());
</code></pre>

<p>But When I am compiling with -Xlint ,its giving below mentioned warning:
Uncheck call getConstructor(java.lang.Class....) as a member of raw type java.lang.Class</p>

<p>What does this mean?</p>
