Hello,
option d) Only public members of the com.amazing.movies package are accessible only to the members of the rentals module.
option e) Inserting requires movies; in rentals module-info enables the rentals module to access members of the com.amazing.movies package of the movies module. (Explanation: The exports and exports-to clauses only make the public members of a package eligible to be accessed from outside the module. But for another module to access the exported packages, it must also have an appropriate requires clause.)
is not the explanation of the correct answer makes the option d correct?
About Question enthuware.ocpjp.v21.2.4023 :
Moderator: admin
-
- Posts: 10
- Joined: Fri Feb 07, 2025 5:36 pm
- Contact:
-
- Site Admin
- Posts: 10408
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v21.2.4023 :
No, because in the given code, module rentals does not have the requires clause. So, even though the exports clause is ok but without the requires clause in rentals, nothing is accessible in rentals.
-
- Posts: 10
- Joined: Fri Feb 07, 2025 5:36 pm
- Contact:
Re: About Question enthuware.ocpjp.v21.2.4023 :
the option is true as long as there is requires clause in the module. thank you.
-
- Site Admin
- Posts: 10408
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v21.2.4023 :
If you look at only the exports clause, then public members of the com.amazing.movies package are accessible to all other modules (assuming that they have appropriate requires clause.)
Who is online
Users browsing this forum: Bing [Bot] and 17 guests