🔒 EXCLUSIVE: T//certification/Chapter page errata - Full Archive

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

Chapter 11, Question 17 (page 359) possible errata

 
Greenhorn
Posts: 14
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question asks for the format pattern that outputs a time similar to "02:33". The answer indicates that "a lowercase h means hour", however per the Oracle documentation (https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/format/DateTimeFormatter.html), both lowercase h and uppercase H represent hour, the former on the am/pm 1-12 basis and the latter based on 0-23. Per the below (and contrary to the text) both options B and D correctly output "02:33"
 
Marshal
Posts: 81697
593
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for delay; I think you are correct that you get 02:33 in both instances. My JShell seems to agree with you too.
 
author & internet detective
Posts: 42204
937
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
Confirmed and added to errata of the practice test book. We should have used 13:33 which would have made it distinct (and B)
 
reply
    Bookmark Topic Watch Topic
  • New Topic