This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
At page 427 of the SCJP Study Guide (1.4) by Kathy Sierra and Bert Bates, one can read about LinkedHashSet the following:
LinkedHashSet lets you iterate through the elements in the order in which they were inserted. Optionally, you can construct a LinkedHashSet so that it maintains the order in which elements were last accessed, rather than the order in which elements were inserted.
What are the constructors/methods that let you construct a LinkedHashSet "so that it maintains the order in which elements were last accessed"?, cause I could not find anything in the API. All the API says is:
This linked list defines the iteration ordering, which is the order in which elements were inserted into the set insertion-order).
Its constructors are:
LinkedHashSet() - Constructs a new, empty linked hash set with the default initial capacity (16) and load factor (0.75).
LinkedHashSet(Collection c) - Constructs a new linked hash set with the same elements as the specified collection.
LinkedHashSet(int initialCapacity) - Constructs a new, empty linked hash set with the specified initial capacity and the default load factor (0.75).
LinkedHashSet(int initialCapacity, float loadFactor) - Constructs a new, empty linked hash set with the specified initial capacity and load factor.
I see nothing like LinkedHashMap's contructor that lets you construct the map so that is order by access:
LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) - Constructs an empty LinkedHashMap instance with the specified initial capacity, load factor and ordering mode.
Somehow you got a hold of a REALLY old copy of the book, because that's an errata we fixed a long time ago. If you just got this book I'd go back to the bookstore and ask for a newer printing - this one should have dust-binned over a year ago
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
I dug up an additional errata document that didn't make it on the Osborne page - sorry! As a temporary kludge I added it to the wickedlysmart site - I'm making a new thread called "Additional errata for the old K&B" with a link to these additional errata. Thanks for bringing this up!
Joined: Dec 01, 2004
Your welcome And thank you too for finding the additional errata.
my books, SCJP 1.4, seems to have 2003 copyright, so I guess it's not updated to the lates errata. I found some unexpected stuff after reading the first chapter and passing the first SELF Test. please post a valid link with the complete errata. I don't want to post stupid, old things.
thank you, silviu busu
subject: Another errata entry to SCJP Study Guide 1.4?