• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Logically Immutable Collection - Sybex CSG 11 p. 651 Kindle Edition

 
Ranch Hand
Posts: 42
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the chapter about upper-bounded wildcards (Chapter 14 Generics and Collections) this is not entirely true:

"Something interesting happens when we work with upper bounds or unbounded wildcards. The list becomes logically immutable and therefore cannot be modified. Technically, you can remove elements from the list, but the exam won't ask about this."

Boyarsky, Jeanne; Selikoff, Scott. OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide (p. 651). Wiley. Kindle Edition.

Technically, you could add a null value making it mutable in both ways (you can both add and remove items).

 
author & internet detective
Posts: 40487
823
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
True. That's a good edge case
 
Greenhorn
Posts: 22
Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:True. That's a good edge case




Jeanne!! What are your insights about the following pos?

https://coderanch.com/t/738108/certification/Errata-OCP-Java-SE-complete

I posted on Jan 6 but I have not gotten any response yet.....
 
Jeanne Boyarsky
author & internet detective
Posts: 40487
823
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
Missed that one. Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic