Page 1 of 1

About Question enthuware.ocpjp.v11.2.3151 :

Posted: Sat Jan 01, 2022 11:41 am
by fssales
Given the following contents of module-info.java:

Code: Select all

module enthu.finance{   
     exports com.enthu.Reports to com.enthu.tax;   
     requires transitive enthu.utils; 
} 
The correct answer is that
Only class from the com.enthu.tax module are allowed to read classes in the com.enthu.Reports package.
Could someone explaining about that option:
The enthu.finance module exports only the those classes that are used by the com.enthu.tax module.
The explanation session don't have any details about this option and I need more clarification.

Is it about automatic modules or unnamed modules?

Thanks

Re: About Question enthuware.ocpjp.v11.2.3151 :

Posted: Sun Jan 02, 2022 4:20 am
by admin
>>The enthu.finance module exports only the those classes that are used by the com.enthu.tax module.

This option does not make any sense because there is no way for a module to know which of its classes are actually being used (or will actually be used) by another module. A module can only specify which of its classes can be used by others by using an appropriate exports clause.