反射
如何偷窥类的隐私(不是)
Class类
public final class Class<T> implements java.io.Serializable,
GenericDeclaration,
Type,
AnnotatedElement {
private static final int ANNOTATION= 0x00002000;
private static final int ENUM = 0x00004000;
private static final int SYNTHETIC = 0x00001000;
private static native void registerNatives();
static {
registerNatives();
}
/*
* Private constructor. Only the Java Virtual Machine creates Class objects. //私有构造器,只有JVM才能调用创建Class对象
* This constructor is not used and prevents the default constructor being
* generated.
*/
private Class(ClassLoader loader) {
// Initialize final field for classLoader. The initialization value of non-null
// prevents future JIT optimizations from assuming this final field is null.
classLoader = loader;
}类加载


反射的使用
Class类及其用法
方法名
说明
Constructor类及其用法
方法返回值
方法名称
方法说明
方法返回值
方法名称
方法说明
Field类及其用法
方法返回值
方法名称
方法说明
方法返回值
方法名称
方法说明
Method类及其用法
方法返回值
方法名称
方法说明
方法返回值
方法名称
方法说明
更多API
最后更新于