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.
A and D
A: source: https://openjdk.java.net/projects/jigsaw/spec/sotms/
The base module defines and exports all of the platform’s core packages.
D: if you create module-info.java, you need to define a module name at least like
module com.x{} OR your app will not Run.
the answer is C E
A and C !
Empty Java module descriptor looks like:
module com.mymodule {
}
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.
I think: C,D