About Question enthuware.ocpjp.ii.v11.2.3439 :
Posted: Thu Jun 04, 2020 7:01 am
Regarding automatic modules, they are said to be able to read every other module on the module path and/or class path without an explicit requires clause, because there is no module-info.java file.
Taken this into consideration, I think the last answer for this question is also correct and the explanation is incorrect:
"java --module-path accounting-3.3.jar;reporting-5.6.jar --module reporting/com.abc.reporting.Main
By putting reporting jar on module path, it has been converted into an automatic module (which is a named module with name reporting without any requires clause.). However, a named module cannot access a class from another named module without appropriate requries clause. Therefore, this command will not work."
Taken this into consideration, I think the last answer for this question is also correct and the explanation is incorrect:
"java --module-path accounting-3.3.jar;reporting-5.6.jar --module reporting/com.abc.reporting.Main
By putting reporting jar on module path, it has been converted into an automatic module (which is a named module with name reporting without any requires clause.). However, a named module cannot access a class from another named module without appropriate requries clause. Therefore, this command will not work."