1. 概述

2. Class

2.1 获取Class对象

2.1.1 getClass()

2.1.2 ${Object}.class

2.1.3 Class.forName()

2.2 Class API

4. Field

2.1 通过Class对象获取

  1. public Field[] getFields();
  2. public Field[] getDeclaredFields();
  3. public Field getField(String name);
  4. public Field getDeclaredField(String name);

2.2 Field API

  1. public String getName();
  2. public boolean isAccessable();
  3. public boolean setAccessable(boolean flag);
  4. public Object get(Object obj);
  5. public void set(Object obj,Object value);

5. Method

5.1 通过Class对象获取

  1. public Method[] getMethods();
  2. public Method[] getDeclaredMethods();
  3. public Method getMethod(String name,Class<?>...parameterTypes);
  4. public Method getDeclaredMethod(String name,Class<?>...parameterTypes);

5.2 Method API

  1. public String getName();
  2. public void setAccessiable(boolean flag);
  3. public Object invoke(Object obj,Object..args) throws IllegalAccessException,IllegalArgumentException,InvocationTargetException;

6. 创建对象的构造方法

7. Class的类型信息

8. 类的声明信息

9. 类的加载

10. 反射与数组

11. 反射与泛型