About Question enthuware.ocpjp.ii.v11.2.3431 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
dongyingname
Posts: 18
Joined: Sat Jun 22, 2019 4:10 pm
Contact:

About Question enthuware.ocpjp.ii.v11.2.3431 :

Post by dongyingname »

Can a jar that owns module-info still becomes a unnamed module?

Option 3:
Just add an empty module-info.java to the jar.
What if the jar is placed on classpath and becomes a unnamed module, which implicitly exports all its packages?

And
Option 2:
Just add module-info to the jar with export clauses for both the packages.
In this case, the library becomes a named module. For all the groups of the company to use it they now have to explicitly requires boundanalytics, don't they? Or is the jar placed on classpass again?

If the answer to my first question is "yes", then option 2 and option 3 are both correct.

I don't know if I am asking these question correctly, as my knowledge of Module is a mess now.
Hope someone can help me answer these questions and clear things up.

admin
Site Admin
Posts: 9380
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3431 :

Post by admin »

Packages contained in a jar present on classpath can only accessed by automatic modules. So, if you put a jar on classpath, its packages still can't be accessed by named modules.

>For all the groups of the company to use it they now have to explicitly requires boundanalytics, don't they?
Yes, of course, but that is only if they are themselves using modules. Otherwise, regular non-modular applications can keep using the modular jar as before. There is no impact.

You can go through the modules chapter of this book to get the fundamentals required for this exam.
If you like our products and services, please help us by posting your review here.

ardurn
Posts: 5
Joined: Thu Mar 05, 2020 4:56 pm
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3431 :

Post by ardurn »

The question mentions a package com.abc.bonds, but the option "Split the jar into two modules" mentions the package com.abc.bond without s in the end. I assume this is a typo?

admin
Site Admin
Posts: 9380
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3431 :

Post by admin »

Right. It should be bonds. Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest