????Java.lang.reflect.Constructor
????Class[] getParameterTypes()
????????????????????????????Class????????
????getReturnType()
????????????????????????????Class????
????int getModifiers()
???????????????????????????????????Class????????
????Class getDeclaringClass()
??????????????????????ж????????????????????Class????
????????????????????
??????????????????????new?????????????new?????????????????????????New??????????δ????????????????????????????????ɡ?????Spring??DI??
???????????ι??????????
????Class.newInstance()
????Class.getConstructor(new Class[]{}).newInstance(new Object[]{})
????????????ι??????????
????Clazz.getConstructor(Class<?> ...ParameterType).newInstance(Object ...initargs)
??????????????

import java.lang.reflect.*;
public class DumpMethods {
public static void main(String args[]) throws Exception{
//???????????????в??????????
Class classType = Class.forName(args[0]);
//?????????з???
Method methods[] = classType.getDeclaredMethods();
for(int i = 0; i < methods.length; i++)
System.out.println(methods[i].toString());
}
}
????java DumpMethods java.util.Stack
public synchronized java.lang.Object java.util.Stack.pop()
public java.lang.Object java.util.Stack.push(java.lang.Object)
public boolean java.util.Stack.empty()
public synchronized java.lang.Object java.util.Stack.peek()
public synchronized int java.util.Stack.search(java.lang.Object)

???????÷????????÷???
????getMethod??invoke??????????