Hans-Joachim Bleichenbacher wrote:In the section about unnamed modules, it is written that "Unnamed modules do not export any packages to named or automatic modules." Furthermore, the Table 12.17 specifies the unnamed modules as unreadable from automatic modules.
Mikalai Zaikin wrote:
Hans-Joachim Bleichenbacher wrote:In the section about unnamed modules, it is written that "Unnamed modules do not export any packages to named or automatic modules." Furthermore, the Table 12.17 specifies the unnamed modules as unreadable from automatic modules.
This part seems not right.
- The unnamed module exports all its packages.
- Classes in the unnamed module are only readable by other classes in the unnamed module AND from classes in automatic modules
- Named module cannot read the classes of the unnamed module (as it may not declare "requires" for the unnamed module in the module-info.java).
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:
I also fixed my mental model. I think the problem was that I didn't realize the automatic module is logically both on the module path (so named modules can access) and classpath (so can access the unnamed module.)
5. A(n) _______________ module is on the classpath while a(n) ____________ module is on the module path. (Choose all that apply.)
A) automatic, named
the automatic module is logically both on the module path (so named modules can access) and classpath (so can access the unnamed module.)
Marco Olivi wrote:
If a jar file is both in the module and the class-path, shouldn't we consider them just like two different jar, first one as an automatic module and the second one as part of the unnamed-module?
That's a very big dog. I think I want to go home now and hug this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|