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

Errata - Sybex 829 - Chapter 9

 
Greenhorn
Posts: 23
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think there is an errata on Chapter 9, on pages 483/484. (Map.of() and Map.CopyOf() explanation):

there is a factory method to create a Map. You pass any number of pairs of keys and values.



This isn't true, Map.of() only accepts maximum of 10 keys and values pairs.

Map also provides a method that lets you supply key/value pairs.


Now we can't forget to pass a value. If we leave out a parameter, the entry() method won't compile.



On the Map.of() if we forget to pass a value, the method won't compile either.

Thanks,
João

 
author & internet detective
Posts: 42154
937
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Confirmed and added to erratas This is another one that was wrong in the Java 11 book without anyone noticing. Have another cow!
 
reply
    Bookmark Topic Watch Topic
  • New Topic