摘要
反射(Reflection)机制是JAVA成为动态语言的一个关键特性,在运行中的Java程序对自身进行检查,或者说“内省”(Introspection),并能直接操作程序的内部属性。这个机制允许程序在执行时可以通过反射APIs取得任何一个已知名称的类的信息,并能在执行时改变类的成员变量(fields)的内容或执行方法(methods).
The reflection mechanism is a key feature that make Java a high dynamic language.During runtime,Java programme inspects itself (a.k.a:introspection),and can directly manipulate the internal attribute of it.The mechanism of reflection allows programme to get the information of any class which has a signature through reflection APIs,and can change the fields or methods during implementation time.
作者
王开
谭翼
周兰江
WANG Kai,TAN Yi,ZHOU Lan-jiang (Faculty of Information Engineering and Automation,Kunming University of Science and Technology,Kunming 650051,China)
出处
《电脑知识与技术》
2007年第1期255-256,共2页
Computer Knowledge and Technology
关键词
反射机制
方法
成员变量
The mechanism of reflection
Introspection
Method
Fields