Online Java Compiler By
JavaTpoint.com
//import statements import java.lang.reflect.Constructor; //import constructor import java.math.BigInteger; //import math package import java.util.Arrays; public class ClassgetConstructorsExample2 { public static void main(String... args) { Constructor>[] cnstrctr = Class1.class.getConstructors(); //getconstructors method Arrays.stream(cnstrctr).forEach(System.out::println); } private static class Class1 { public Class1() { } public Class1(int x) { } public Class1(String s, BigInteger[] integers) { //constructor with 2 parameter } } }
Output