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