Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

1Z0-829 OCP Java 17 book error

 
Ranch Hand
Posts: 74
2
Mac IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Table 9.6, on page 485 "Using the Map interface" the word Bi is missing:



should be:

 
author & internet detective
Posts: 41964
911
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
Agreed and added to the errata. Thanks!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On Review Questions chapter 4, question 10.
The last line of code should not compile, the values are not doubles

26: var doubles = new double[] {one, two, three};

So the rigth answer is B. (1 compile error )and not A
 
Marshal
Posts: 79630
380
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Have you tried the code? The values in the following code undergo automatic widening conversion:-

jshell> int one = 1, two = 2, three = 3; var doubles = new double[] {one, two, three};
one ==> 1
two ==> 2
three ==> 3
doubles ==> double[3] { 1.0, 2.0, 3.0 }

I shouldn't have declared multiple values on the same line.
 
reply
    Bookmark Topic Watch Topic
  • New Topic