[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
Early Charlemagne wrote:Hi,
I have a query about Automatic modules.
On Chapter 6 in the Java OCP 11 Programmer II Study Guide by Scott Selikoff and Jeanne Boyarsky it's written "A key point to remember is that code on the classpath can access the module path. By contrast, code on the module path is unable to read from the classpath."
Also, looking at Table 6.3 (see attachment) I understand that Automatic modules cannot access unnamed modules on the classpath.
However, I read elsewhere the following:
Remember that modular code cannot access code present on the -classpath but "automatic modules" are an exception to this rule. When a non-modular jar is put on --module-path, it becomes an "automatic module" but it can still access all the modular as well as non-modular code. In other words, a class from an automatic module can access classes present on --module-path as well as on -classpath without having any "requires" clause
Did I misunderstand the information in Java OCP 11 Programmer II Study Guide?
Andre Garcia wrote:I'm still struggling to understand this concept (Automatic Modules can or cannot access Unamed?)..I have bought the perfect duo: Scott Selikoff and Jeanne Boyarsky's book and Enthuware mock tests..can someone point where I'm wrong, please? See
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
Consider Paul's rocket mass heater. |