• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

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

 
Ranch Hand
Posts: 415
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 71028
291
  • Mark post as helpful
  • send pies
  • 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: 40283
819
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • 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: 415
8
  • Mark post as helpful
  • send pies
  • 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!
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic