Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 111

Given:

Given the directory structure:

Given the commands to execute at the Test directory prompt:

Which statement is true?

    Correct Answer: D

    The provided code snippet utilizes the `Module` class in Java to obtain and print information about the module in which the class `Hello` resides. When executed with the provided commands (`javac -d pac Hello.java` and `java -cp pac pac.Hello`), the program operates in an unnamed module since it is run from the classpath and not the module-path. As a result, the program prints 'Module: unnamed module', 'Name: null', and 'Descriptor: null' because unnamed modules do not have a name or descriptor.

Discussion
[Removed]Option: D

D is indeed Correct. Tested

ASPushkinOption: D

Of course, syntax error has to be corrected javac -d pac Hello.java -> javac -d Test Hello.java java -cp pac pac.Hello -> java -cp Test Test.Hello

ASPushkinOption: D

D. correct this class loadedd using classpath so this is unnamed moduler A. Failed unnamed moduler doesn't have moduler-info