Oracle
1Z0-819 · Question #59
Given an application with a main module that has this module-info.java file: module main { exports country; uses country.CountryDetails; } Which two are true? (Choose two.)
The correct answer is B. B. A module providing an implementation of country.CountryDetails must have a requires main; directive in its module-info.java file. See the full explanation below for the reasoning.
Question
Given an application with a main module that has this module-info.java file:
module main {
exports country;
uses country.CountryDetails;
}
Which two are true? (Choose two.)
Options
- AA module providing an implementation of country.CountryDetails can be compiled and added without recompiling the main module.
- BB. A module providing an implementation of country.CountryDetails must have a requires main; directive in its module-info.java file.
- CC. An implementation of country.CountryDetails can be added to the main module.
- DD. To compile without an error, the application must have at least one module in the module source path that provides an implementation of country.CountryDetails.
- EE. To run without an error, the application must have at least one module in the module path that provides an implementation of country.CountryDetails.
How the community answered
(36 responses)- A8% (3)
- B83% (30)
- C3% (1)
- E6% (2)
Community Discussion
No community discussion yet for this question.