1
bumz 2019-07-13 08:34:54 +08:00 via iPhone
Reflection
|
2
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()); } } } ``` |
3
qwertyegg OP 多谢 @bumz @jaylee4869
|