About Question enthuware.ocpjp.i.v11.2.3014 :

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

Moderator: admin

Post Reply
radupana
Posts: 28
Joined: Fri Feb 09, 2018 11:50 am
Contact:

About Question enthuware.ocpjp.i.v11.2.3014 :

Post by radupana »

Hi,

The solution marked as correct says that: "This file must be present in enthu.finance directory."

However, I don't believe this is mandatory, is it?

For example, we can have a structure like:

C:\1Z0-817
└───mod1
│ module-info.java

└───by
└───boot
└───java
└───pkg
└───logger
MyLogger.java

With module-info.java containing:

Code: Select all

module by.boot.java.mod.logger {
}
In this case, module-info.java is placed in the mod1 folder even though it defines a module called by.boot.java.mod.logger (the folder name and module name are not the same).

Thanks.

Regards,
Radu

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

Re: About Question enthuware.ocpjp.i.v11.2.3014 :

Post by admin »

If your --module-source-path is, for example, c:\temp\modules, then your enthu.finance module must be in c:\temp\modules\enthu.finance and its module-info.java must be in c:\temp\modules\enthu.finance\

If you put the packages of this module in c:\temp\modules\someothername, then --module-source-path will not find the module enthu.finance.

radupana
Posts: 28
Joined: Fri Feb 09, 2018 11:50 am
Contact:

Re: About Question enthuware.ocpjp.i.v11.2.3014 :

Post by radupana »

Thank you for the explanation

radkon
Posts: 1
Joined: Tue Dec 29, 2020 4:22 am
Contact:

Re: About Question enthuware.ocpjp.i.v11.2.3014 :

Post by radkon »

admin wrote:
Fri Jun 28, 2019 9:59 am
If your --module-source-path is, for example, c:\temp\modules, then your enthu.finance module must be in c:\temp\modules\enthu.finance and its module-info.java must be in c:\temp\modules\enthu.finance\

If you put the packages of this module in c:\temp\modules\someothername, then --module-source-path will not find the module enthu.finance.
You assume that the compilation will be executed with the --module-source-path. This is not defined in the question.
You could as well be using this version of the command:

Code: Select all

javac -d someBuildPath src/module-info.java src/a/b/c/Main.java
in this case, the module name is totally decoupled from any file path.

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

Re: About Question enthuware.ocpjp.i.v11.2.3014 :

Post by admin »

You are right. In general, there is no restriction on where the java source file resides. However, for the purpose of the exam, in case of modules, you should assume that module-info.java resides in a directory whose name is same as the module name.
Updated the question to make it clear.
thanks for the feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests