public class Test {
public static void main(String[] args) {
Class clazzProxy1 = Proxy.getProxyClass(Collection.class.getClassLoader(), Collection.class);
System.out.println(clazzProxy1.getName());
Constructor[] constructors = clazzProxy1.getConstructors();
for(Constructor constructor:constructors){
String name = constructor.getName();
StringBuilder sBuilder = new StringBuilder(name); sBuilder.append("(");
Class[] clazzParams = constructor.getParameterTypes();
for(Class clazzParam:clazzParams)
{
sBuilder.append(clazzParam.getName()).append(',');
}
sBuilder.append(")");
}
}
}
上面红色字体在StringBuilder()里的name是什么意思啊?为什么要把name传进去呢?我没明白! |