java.lang.Class.getConstructor()


java.lang.Class.getConstructor()

package com.codingdict;



import java.lang.reflect.*;



public class ClassDemo {



   public static void main(String[] args) {



      try {

         // returns the Constructor object of the public constructor

         Class cls[] = new Class[] { String.class };

         Constructor c = String.class.getConstructor(cls);

         System.out.println(c);

      } catch(Exception e) {

         System.out.println(e);

      } 

   }

}