Return to site

JAVA CERTIFICATION QUESTION: Declaring and accessing Java modules

=>How do you provide access to a module’s classes to code outside that module?

· java,ocp

Imagine you are developing a date/time manipulation framework.

The framework module is named date.time.utils and contains classes in the com.acme.utils package.

The Java Date/Time API is located in the java.time package, which is in the java.base module.

Which of the following steps is mandatory to properly define your module for your clients? Choose one.

A. Add the following to the date.time.utils module descriptor:

requires transitive java.base;

B. Add the following to the date.time.utils module descriptor:

requires java.base;

Also inform your clients to add the following in their modules:

requires java.base;

C. Add the following to the date.time.utils module descriptor:

exports date.time.utils;

D. Add the following to the date.time.utils module descriptor:

exports com.acme.utils;

 

 

 

 

 

 

·ꓷ uoᴉʇdo sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnʅɔuoꓛ