• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Sybex Practice Tests 11 error - Chapter 7 (Java Platform Module System) Q 12

 
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

Maybe this error does not belong to this book, but I noticed a conflict between algorithm for determining the name of an automatic module (OCP Java 11 Study guide part II) and explanation in Practice tests book for question 12 in Chapter 7.
Algorithm in Study guide says "Replace any remaining characters other than letters and numbers with dots". However, in practice tests book, correct name for automatic module for dog-arthur2.jar is said to be "dog.arthur" instead of "dog.arthur2". Explanation for this is "The rules for determining the name include removing the extension, removing numbers, and changing special characters to periods ( . )".

According to study guide's algorithm it should be dog.arthur2 or am I wrong? "2" shouldn't count as version information here or should it?
 
J Noot
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, according to Oracle docs the correct answer should be dog.arthur2 not dog.arthur as said in explanation.

If starting point is dog-arthur2.jar:

1. ".jar" is removed: dog-arthur2
2. name "dog-arthur2" does not match regular expression "-(\\d+(\\.|$))" for removing version
3. All non-alphanumeric characters ([^A-Za-z0-9]) in the module name are replaced with a dot ("."): dog.arthur2

So the correct answer is dog.arthur2 and numbers are not removed
 
author & internet detective
Posts: 42103
933
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
You are correct! I've added this to the errata.

I dislike the way this works, but that doesn't change the behavior .
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic