本講座剖析 Java 的反射:如何透過
Class API 取得欄位(
getFields()/
getDeclaredFields())、方法(
getMethods()/
getDeclaredMethods())、建構子(
getConstructors()/
getDeclaredConstructors())與註解(
getAnnotations())等資訊。也會透過
Modifier 取得修飾詞(
public、
private、
protected、
static、
final),釐清「public 與 declared」的差異,組裝一個簡易的類別檢查器小工具,並看看視覺化示意圖。