Which two statements are correct about modules in Java? (Choose two.)
Which two statements are correct about modules in Java? (Choose two.)
A module must be declared in a module-info.java file because this file is essential for defining the module's name and its various properties such as dependencies and exported packages. The java.base module exports all of the core packages of the Java platform, making it fundamental for the function and structure of Java applications.
D AND E IS CORRECT:_ D. A module must be declared in module-info.java file. E. java.base exports all of the Java platforms core packages.
D & E are correct. A incorrect because module-info.java can be empty. See: https://www.oracle.com/corporate/features/understanding-java-9-modules.html#:~:text=The%20module%20declaration's%20body%20can,a%20file%20named%20module%2Dinfo.
A is correct because module-info.java cannot be empty, at minimum, it must specify the name of the module, like for example: module com.a { } . D is also correct because: "module declaration, a file with the name module-info.java that defines all properties of a module" (from https://dev.java/learn/modules/intro/). E is not correct because here is written "all of the Java platforms"- these are Java SE, Java ME, Java EE. So, the correct answers are: A and D...I think..
A is correct because module-info.java cannot be empty, at minimum, it must specify the name of the module, like for example: module com.a { } . D is also correct because: "module declaration, a file with the name module-info.java that defines all properties of a module" (from https://dev.java/learn/modules/intro/). E is not correct because here is written "Java platforms"- these are Java SE, Java ME, Java EE. So, the correct answers are: A and D...I think..
A module-info.java file is used to declare a module and its dependencies. It must contain at least one module declaration, so statement A is incorrect. The module-info.java file must be placed in the root directory of the module, so statement B is incorrect. Modules do not have access to each other by default, regardless of their location, so statement C is incorrect. The java.base module exports all of the core packages of the Java platform, so statement E is correct.
d-100% e-80%
Answer: CD