Help coderanch get a
new server
by contributing to the fundraiser
  • 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

Another errata entry to SCJP Study Guide 1.4?

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey John -

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

hth,

Bert
 
John Brown
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bert, yeah, I have the oldest book, in fact, it's THE first copy printed
But I've searched the errata (http://books.mcgraw-hill.com/downloads/products/0072226846/0072226846_errata.txt) last updated March 3 2003, and couldn't find anything. Is there another newer errata somewhere ?
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey John,

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!

Bert
 
John Brown
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your welcome And thank you too for finding the additional errata.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

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
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic