Java Module Migration: Top-Down vs Bottom-Up
Short answer
B Every module is moved to the module path in a top-down migration.
Question
Key Takeaways
The key insight is distinguishing the direction of dependency resolution: top-down resolves dependencies from root to leaf, while bottom-up resolves from leaf to root. The common trap is confusing which migration strategy moves all modules to the module path versus keeping some on the classpath.
This question tests the differences between top-down and bottom-up migration strategies in the Java Platform Module System (JPMS). It establishes that in a top-down migration, every module is moved to the module path.
Common mistake: Many candidates choose option A because they associate 'bottom-up' with building from the base, but forget that bottom-up migration typically keeps unnamed modules on the classpath to resolve circular dependencies before moving them.
Expert Analysis
Why the Answer Is Correct
In a top-down migration, the process starts with the main application module (the root) and proceeds downwards through its dependencies. In this strategy, every module is moved to the module path. This allows the module system to validate the entire graph at once, assuming no circular dependencies exist among the unnamed/automatic modules being converted.
Why the Other Options Are Wrong
Option A is incorrect because in a bottom-up migration, modules are moved from the leaves up to the root. During this process, unnamed modules might remain on the classpath until their dependencies are resolved, so it's not strictly true that every module is moved to the module path simultaneously or in the same manner as top-down. Option C is vague; while unnamed modules become automatic modules, the defining characteristic of top-down migration is the movement of all modules to the module path. Option D describes a dependency resolution order (required modules before dependents), which is generally true for compilation but doesn't define the migration strategy itself as precisely as B.
Community Comment Notes
The community consensus strongly favors option B. As user 'Tojose' noted, "I think the correct answer is B. Every module is moved to the module path in a top-down migration." Another user, 'leylapanaxi', clarified that "All modules are moved to module path in bottom-up approach" was a misconception, reinforcing that B is the distinct characteristic of top-down migration in this context. User '9817c20' simply stated "B iz ze correct answer," reflecting the high agreement rate.
Exam Strategy
When studying JPMS migration, focus on the distinction between top-down and bottom-up approaches. Remember that top-down migration requires all modules to be on the module path, while bottom-up allows for gradual conversion where some modules may remain on the classpath initially.
Frequently Asked Questions
Why is bottom-up migration different from top-down?
Can unnamed modules be used in top-down migration?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 5
-
Tojose 👍 3I think the correct answer is B. Every module is moved to the module path in a top-down migration.
-
leylapanaxi 👍 1 Answered BAll modules are moved to module path in bottom-up approach
-
zuluitai 👍 1 Answered BB is the correct answer here.
-
9817c20 👍 1B iz ze correct answer.
-
Uteman 👍 1B is correct
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.