• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sybex 829 errata? Isn't 'import' allowed in module-info.java?

 
Ranch Foreman
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

tb864615.OCPJAVASE17PT.c07.035
How many of these directives can be used in a module-info.java file: closes, export, import, require, and uses?
A. None
B. One
C. Two
D. Three
E. Four
F. Five



The given answer is B. One

You need to know these directives: exports, requires, requires transitive, provides, opens, and uses. Of these, only uses is in the list of candidates in the question, which means option B is correct. Note that export and require are invalid because they should be exports and requires, respectively.



But I do not see a compiler error when I add this import to the module-info.java



Is this a question error?
 
Saloon Keeper
Posts: 15442
362
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it's an error in the question and it was already discussed here: https://coderanch.com/t/778829/certification/Sybex-Practice-Tests-Chapter-Java
 
Master Rancher
Posts: 4760
71
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're right, it is a question error.  It was recently addressed here:

https://coderanch.com/t/778829/certification/Sybex-Practice-Tests-Chapter-Java

But now that I've seen the question text, which was not present in the original thread...

I would argue that the question needs more changing than simply changing the answer.  It says "How many of these directives" and lists "import" - but import is not a directive.  So it's ambiguous whether the answer should include import, since it is legal to use the keyword "import" in a module-info.java file, but it's not a directive.  

Possible fixes for the question:

Change "directives" to "directives and keywords".  Or change "these directives" to "these terms." Answer: C) Two - uses and import

Change "import" to "imports".  Answer: B) One - uses

"imports" sounds plausible enough, considering "exports" would have been valid.  But it's not actually a legal directive.  Or keyword.
 
Anil Philip
Ranch Foreman
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:You're right, it is a question error.  It was recently addressed here:

https://coderanch.com/t/778829/certification/Sybex-Practice-Tests-Chapter-Java



Thank you, Mike and Stefan. Perhaps the authors should have corrected it since it is hosted online at Wiley.
 
Mike Simmons
Master Rancher
Posts: 4760
71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I don't know if Wiley has online errata somewhere or what their policy is - but the authors have their own errata page:

https://www.selikoff.net/ocp17-pt/

Jeanne Boyarsky is one of the authors, and checks these threads regularly, incorporating feedback into the errata.  She's the one who posted the last post in that other thread.

Unfortunately in this case, her last reply was

Jeanne Boyarsky wrote:I'm not putting this in the errata because the book doesn't cover it.But I making a note for next time.


That seems a bit strange to me.  The question and answer are broken as written.  Some people will know that, and some won't, based on whether they know more than what's in the book.  It seems a bit unfair to penalize those who know the correct answer because it wasn't covered in the book.  Better to alter the question to avoid the problem, I think.
 
Anil Philip
Ranch Foreman
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:Well, I don't know if Wiley has online errata somewhere or what their policy is - but the authors have their own errata page:



I meant that there is an app on a server https://www.efficientlearning.com/ that pops up the test questions just like in the exam.
It can be corrected on the server so that no one has to needlessly see the broken questions over again, after the first acknowledgement.
 
author & internet detective
Posts: 41855
904
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:

Jeanne Boyarsky wrote:I'm not putting this in the errata because the book doesn't cover it.But I making a note for next time.


That seems a bit strange to me.  The question and answer are broken as written.  Some people will know that, and some won't, based on whether they know more than what's in the book.  It seems a bit unfair to penalize those who know the correct answer because it wasn't covered in the book.  Better to alter the question to avoid the problem, I think.



Judgment call? The problem is that there are multiple target audiences. And I feel putting it in the errata will confuse people who know less. The purpose of these questions is to get people ready for the test.  And as you noted, import is not a directive so it isn't technically wrong.

I do agree it should be fixed next edition which is why I put it in my own list.

Anil Philip wrote:

Mike Simmons wrote:Well, I don't know if Wiley has online errata somewhere or what their policy is - but the authors have their own errata page:



I meant that there is an app on a server https://www.efficientlearning.com/ that pops up the test questions just like in the exam.
It can be corrected on the server so that no one has to needlessly see the broken questions over again, after the first acknowledgement.


It's non trivial to get stuff corrected on the website.  This particular one I don't consider a priority though.
 
reply
    Bookmark Topic Watch Topic
  • New Topic