exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 11 discussion

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

Which module-info.java is correct for a service provider for a print service defined in the PrintServiceAPI module?

  • A. module PrintServiceProvider {
    requires PrintServiceAPI;
    exports org.printservice.spi;
    }
  • B. module PrintServiceProvider {
    requires PrintServiceAPI;
    provides org.printservice.spi.Print with
    com.provider.PrintService;
    }
  • C. module PrintServiceProvider {
    requires PrintServiceAPI;
    uses com.provider.PrintService;
    }
  • D. module PrintServiceProvider {
    requires PrintServiceAPI;
    exports org.printservice.spi.Print with
    com.provider.PrintService;
    }
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
3 months, 3 weeks ago
Selected Answer: B
answer: B provides <service-interface> with <service-implementation> A module can specify that it provides a service with a specific type of service provider. "requires PrintServiceAPI" bacause service provider is defined in the third separate module PrintServiceAPI.
upvoted 1 times
...
Stavok
1 year, 6 months ago
Selected Answer: B
The correct answer is B. A service provider module should use the provides directive to declare that it provides an implementation of a service. The provides directive specifies the service type and the implementation class. In this case, the PrintServiceProvider module provides an implementation of the org.printservice.spi.Print service with the com.provider.PrintService class.
upvoted 2 times
...
aruni_mishra
1 year, 7 months ago
Selected Answer: B
B: https://www.logicbig.com/tutorials/core-java-tutorial/modules/services.html
upvoted 1 times
...
aruni_mishra
1 year, 7 months ago
B: Correct. service provider provides service using below syntax: module SERVICEPROVIDER { requires MODULENAME1; requires MODULENAME2; provides SERVICEINTERFACE with IMPLEMENTATION; } https://www.logicbig.com/tutorials/core-java-tutorial/modules/services.html
upvoted 1 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