exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 127 discussion

Actual exam question from Oracle's 1z0-819
Question #: 127
Topic #: 1
[All 1z0-819 Questions]

Given the code fragment:



and

module greeting {
}

Which statement is true?

  • A. All members of com.name are accessible only to the citizen and greeting modules.
  • B. public members in the com.name package are accessible only to the greeting module.
  • C. Inserting "requires citizen" at greeting's module-info.java, enables com.name members accessible to the greeting module.
  • D. All members in the com.name package are accessible only to the greeting module.
  • E. public members in the com.name package are accessible to all modules.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ASPushkin
2 months ago
Selected Answer: C
The exports to directive in the citizen module doesn't exempt the target module from explicitly requiring the dependency module. Just specifying export package in the required module is not enough.
upvoted 2 times
...
cathDev
3 months ago
Selected Answer: B
The correct statement is B. public members in the com.name package are accessible only to the greeting module
upvoted 1 times
...
d7bb0b2
6 months ago
Selected Answer: B
A is bad : citizen has only access to public members of pacakge
upvoted 1 times
...
d7bb0b2
7 months ago
B is correct, to use exports to permit to access to public members from com.name wihtouht explicit requires in module-info .
upvoted 1 times
...
Omnisumem
9 months, 1 week ago
Selected Answer: B
Agree with Stavok. An exports…to directive enables you to specify in a comma-separated list precisely which module’s or modules’ code can access the exported package—this is known as a qualified export.
upvoted 1 times
...
dilleman
9 months, 1 week ago
C does sound correct. B is probably not correct since the public members in com.name is also available to the citizen-module.
upvoted 1 times
...
Ashan_Ozlov
9 months, 1 week ago
Selected Answer: C
The correct answer should be C
upvoted 1 times
...
Stavok
11 months, 3 weeks ago
Selected Answer: B
The correct answer is B. An exports module directive specifies one of the module’s packages whose public types (and their nested public and protected types) should be accessible to code in all other modules1. In this case, the citizen module exports the com.name package to the greeting module, making its public members accessible only to the greeting module.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago