jaylee4869
2019-07-19 10:08:48 +08:00
同楼上,反射.
```
public static void main(String[] args) throws ClassNotFoundException {
Class clazz = Class.forName("com.reflection.People");
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
System.out.println(method.getName());
Parameter[] parameters = method.getParameters();
for (Parameter parameter : parameters) {
System.out.println(parameter.getName());
}
}
}
```