[英]Java Reflection- getting names of parameter types
for(Method m: c.getMethods()){
Type[] parameters = m.getParameterTypes();
String[] theParameters;
for (Type par: parameters){
theParameters.add(par.getSimpleName());
}
I am trying to store the names of each of the parameters in a String array but this doesnt seem to work 我试图将每个参数的名称存储在一个String数组中,但这似乎不起作用
如果您尝试获取实际参数“名称”而不是其类型,请参阅此答案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.