public class Test07 {
public static void main(String[] args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException,SecurityException,NoSuchMethodException, InstantiationException {
Constructor<Demo> ca = Demo.class.getConstructor();
Demo d = ca.newInstance();
Method m = Demo.class.getMethod("print");
System.out.println(m.invoke(d));
}
}
class Demo
{
public Demo(){};
public void print()
{
System.out.println("woshishuaige");
}
}