Online Java Compiler By
JavaTpoint.com
//import statements import java.lang.reflect.*; public class ClassgetConstructorExample1 { public static void main(String[] args) { try { Class clsarray[] = new Class[] { String.class }; //creating array Constructor cnstrctr = String.class.getConstructor(clsarray); //get the constructor System.out.println(cnstrctr); //print the constructor } catch(Exception e) { System.out.println(e); //print exception object } } }
Output