Java Module Migration: Top-Down vs Bottom-Up
Which statement is true about 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.
Community Insight
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.
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.
Community Discussion (5 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
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?
Bottom-up migration starts from leaf modules and moves up, potentially keeping unnamed modules on the classpath until dependencies are resolved. Top-down moves all modules to the module path from the start.
Can unnamed modules be used in top-down migration?
Yes, but they must be converted to automatic modules or named modules and placed on the module path. The key is that all modules end up on the module path in top-down migration.