• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sybex 816 Java OCP 11 Programmer II Study Guide Set.of Errata

 
Ranch Hand
Posts: 499
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Like List, you can create an immutable Set in one line or make a copy of an existing one.



VitalSource page 123 produces:
Exception in thread "main" java.lang.IllegalArgumentException: duplicate element: o
 
Marshal
Posts: 79060
375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that behaviour is specified in the API documentation. I presume you have checked to confirm that is a new erratum.
 
author & internet detective
Posts: 41855
904
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
Added to errata. I can't believe that snuck into the book!

I even wrote a blog post last year when I discovered that behavior.
 
Charles O'Leary
Ranch Hand
Posts: 499
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne BoyarskyI even [url=https://www.selikoff.net/2019/05/26/did-you-know-set-of-does-that/ wrote:wrote a blog post last year[/url] when I discovered that behavior.


Nice write up.  Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic