Reflection lets a program inspect and manipulate classes, methods, and fields at runtime — even ones unknown at compile time. Annotations attach metadata to code that tools and frameworks read (often via reflection) to drive behavior. Together they power much of Java's framework "magic" (Spring, JPA, JUnit).
Reflection — runtime inspection and invocation
Class<?> clazz = Class.forName();
(Field field : clazz.getDeclaredFields()) {
System.out.println(field.getName() + + field.getType());
}
(Method method : clazz.getDeclaredMethods()) {
System.out.println(method.getName());
}
clazz.getDeclaredConstructor().newInstance();
clazz.getMethod(, String.class);
m.invoke(instance, );
clazz.getDeclaredField();
f.setAccessible();
