• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Sybex Practice Tests 11, possible errata, chapter 7, Q 57 and Q 58 and Q 59

 
Ranch Hand
Posts: 73
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

Question 57 on page 258 asks what needs to be included in the module-info for it to be a service provider:

Question 56:
You have the following interface in a module named animal.insect.api.



Question 57:
And you have the following class in a module named animal.insect.impl and the service provider interface module from question 56 (from above). What needs to be included in the module-info for it to be a service provider? (Choose two.)



A. requires animal.insect.api.bugs;
B. requires animal.insect.lookup;
C. requires animal.printer;
D. provides animal.insect.impl.Worm;
E. provides animal.insect.api.bugs.Bug with animal.insect.impl.Worm;
F. provides animal.insect.impl.Worm with animal.insect.api.bugs.Bug;

And the answer on page 514 is:

A, E. This module is a service provider. It needs a requires directive for the service provider interface, which is option A. It also needs a provides directive which specifies both the interface and implementation. Option E has both in the correct order.

But A is not right because the directive is:

requires <module> not requires <package>

And question 58 also:

Suppose you have the following class in a module named animal.insect.lookup, the service provider interface from question 56 (from above), and the service provider from question 57. What needs to be included in the module-info file besides an exports directive for it to be a service locator? (Choose two.)



A. provides animal.insect.lookup;
B. provides animal.insect.lookup.InsectFinder;
C. requires animal.insect.api.bugs;
D. requires animal.insect.api.Bug;
E. uses animal.insect.api.bugs;
F. uses animal.insect.api.bugs.Bug;

And the answer on page 514 is:

C,F. This module is a service locator. It needs three directives: exports, requires, and uses. The requires directive specifies the module it depends on, which is option C. The uses directive specifies the service provider interface it references, which is option F.

Answer C is not right because like on question 58 requires directive needs a module not a package! And animal.insect.api.bugs is a package. In question 56 they name the interface module animal.insect.api not animal.insect.api.bugs

And the same problem is on question 59, with answer A,B, but A is not right because in A in the requires directive the package animal.insect.api.bugs is mentioned but it should be the module animal.insect.api!

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic