Given the module descriptor and invocation, what will happen?
--add-modules makes com.example.store available to other modules, including the main module.
Why this answer
Option A is correct because the `--add-modules com.example.store` directive explicitly adds the module `com.example.store` to the set of root modules at startup, making its exported packages available to the unnamed module (or to modules that do not otherwise require it). Since the `Main` class is in the unnamed module (not in a named module), it can access the exported packages of `com.example.store` without a `requires` clause. This is the intended behavior of `--add-modules` for resolving modules that are not automatically resolved.
Exam trap
The trap here is that candidates often assume that simply placing a module on the module path makes it automatically accessible to the unnamed module, but the module system requires explicit opt-in via `--add-modules` for modules not required by a named module.
How to eliminate wrong answers
Option B is wrong because `NoClassDefFoundError` would occur only if a class was present at compile time but missing at runtime; here, the module is explicitly added via `--add-modules`, so the classes are available. Option C is wrong because simply being on the module path does not automatically resolve a module for the unnamed module; the module must be explicitly added with `--add-modules` or be a root module (e.g., via `requires` in a named module). Option D is wrong because `ModuleNotFoundException` is thrown only when a module cannot be found on the module path or when `--add-modules` specifies a non-existent module; here, `com.example.store` exists on the module path and is explicitly added, so no exception occurs.