🪞 Reflection, Annotations & Modules
12 Java concepts, each explained step by step with real code, a common trap and practice questions.
- The Class objectgetClass(), .class literals, Class.forName.
- ReflectionInspecting and invoking fields, methods and constructors at runtime; setAccessible and its cost.
- Built-in annotations@Override, @Deprecated, @SuppressWarnings, @FunctionalInterface, @SafeVarargs.
- Custom annotations@interface, elements, @Retention, @Target, @Inherited, @Repeatable.
- Processing annotationsRuntime reflection vs compile-time annotation processors (Lombok, MapStruct).
- Dynamic proxiesjava.lang.reflect.Proxy and how frameworks add behavior.
- MethodHandlesA faster, typed alternative to reflection.
- The module system (JPMS)module-info.java, requires, exports, opens, strong encapsulation.
- Classpath vs module pathUnnamed and automatic modules.
- ServiceLoaderPlug-in discovery with provides/uses.
- Module import declarationsJava 25 import module java.base;.
- Foreign Function & Memory APIJava 22 calling native code and off-heap memory without JNI.