Which two statements are correct about modules in Java?

Which two statements are correct about modules in Java? (Choose two.)
A. java.base exports all of the Java platforms core packages.
B. module-info.java can be placed in any folder inside module-path.
C. A module must be declared in module-info.java file.
D. module-info.java cannot be empty.
E. By default, modules can access each other as long as they run in the same folder.

Download Printable PDF. VALID exam to help you PASS.

5 thoughts on “Which two statements are correct about modules in Java?

    1. I don’t think C is correct because automatic/unnamed modules don’t need the module-info.java file descriptor. I think D is correct because the module-info.java file at least needs to have the declaration of the module name

      module com.mymodule{
      }

      … and therefore it cannot be empty. So A,D should be correct.

      2
      4

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.