World 22 of 26 · Advanced

🪞 Reflection, Annotations & Modules

12 Java concepts, each explained step by step with real code, a common trap and practice questions.

  1. The Class objectgetClass(), .class literals, Class.forName.
  2. ReflectionInspecting and invoking fields, methods and constructors at runtime; setAccessible and its cost.
  3. Built-in annotations@Override, @Deprecated, @SuppressWarnings, @FunctionalInterface, @SafeVarargs.
  4. Custom annotations@interface, elements, @Retention, @Target, @Inherited, @Repeatable.
  5. Processing annotationsRuntime reflection vs compile-time annotation processors (Lombok, MapStruct).
  6. Dynamic proxiesjava.lang.reflect.Proxy and how frameworks add behavior.
  7. MethodHandlesA faster, typed alternative to reflection.
  8. The module system (JPMS)module-info.java, requires, exports, opens, strong encapsulation.
  9. Classpath vs module pathUnnamed and automatic modules.
  10. ServiceLoaderPlug-in discovery with provides/uses.
  11. Module import declarationsJava 25 import module java.base;.
  12. Foreign Function & Memory APIJava 22 calling native code and off-heap memory without JNI.