代码是这样的
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
public class Demo {
public static void main(String[] args) {
try {
Class c = Class.forName("Example");
Constructor cons[] = c.getConstructors();
for (Constructor con : cons) {
System.out.println(Modifier.toString(con.getModifiers()));
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}