Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
ASPushkin
1 week, 5 days 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 1 times
...
cathDev
1 month, 1 week 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
4 months, 1 week ago
Selected Answer: B
A is bad : citizen has only access to public members of pacakge
upvoted 1 times
...
d7bb0b2
5 months, 1 week 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
7 months, 2 weeks 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
7 months, 2 weeks 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
7 months, 2 weeks ago
Selected Answer: C
The correct answer should be C
upvoted 1 times
...
Stavok
10 months 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 ...