首页 试题广场 > 试题详情
单选题

【C012033】考虑下面这个简单的例子,让我们看看reflection是如何工作的。
import java.lang.reflect.*;
public class DumpMethods{
public static void main(String[] args) {
try {
Class c=Class.forName(args[0]);
Method m[]=c.getDeclaredMethods();
for (int i = 0; i < m.length; i++) {
System.out.println(m[i].toString());
}
} catch (Throwable e) {
System.err.println(e);
}
}
}
其中"c.getDeclaredMethods"的作用是:

  • A.取得类的公有方法对象
  • B.取得类的所有公有方法名称
  • C.取得类的所有方法对象
  • D.以上选项都不正确
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 31个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部