1. Why do we need the java reflection?
? ? ?Answer: ?to discover the information about an object at the runtime.so it is a dyamic mechansim.
2. Wiki says the reflection is:
? the program observe itself,modifies itself structure and action(行為).
3. what can reflection can do at the runtime ? ? ? ? ? ? ? ? ? ? ? ?(在運行時)?
? ?判斷任意一個對象所屬的類;
? ?構(gòu)造任意一個類的對象;
? ?判斷任意一個類所具有的成員變量和方法;
? ?調(diào)用任意一個對象的方法;
? ?生成動態(tài)代理。

3 steps the reflection do
4: talk about Classes
? ? ? In java,the object(對象)有兩種類型:引用類型和基本類型
引用類型 extends java.lang.Object
基本類型 ?boolean, byte, short, int, long ,double ,char ,float

理解 class 和 object
java reflection 允許在程序運行時去獲取一個class(類)的成員變量和方法。
虛擬機在class文件的加載階段,把類信息保存在方法區(qū)數(shù)據(jù)結(jié)構(gòu)中,并在Java堆中生成一個Class對象,作為類信息的入口。

class對象