Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

OCP Java SE 11 Programmer II Study Guide, Errata

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I would say that the fourth line of the output should look like this:

Enter a password between 5 and 10 characters:

instead of

Enter a password between 5 and 10 digits:

because the code looks like this:
 
Marshal
Posts: 70718
288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Maybe the code sample requires the password be in the form of a number.
By the way: Do you know under which circumstances that sort of code can fail with an exception?
 
Daniel Polách
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the code sample still states characters instead of digits. ;-)

Can it fail when the stream for a console is closed? :-)
 
Campbell Ritchie
Marshal
Posts: 70718
288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try it on your IDE and see what happens.
 
author & internet detective
Posts: 40246
819
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ooh. Good catch. I've added this to the errata.

Yes, the output of code should match the string the code prints .
 
reply
    Bookmark Topic Watch Topic
  • New Topic