• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Section 9.2 - Beta 1.4 SCJP objectives

 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm taking the 1.4 Beta next month... and wanted a bit of clarification on Section 9.2 in the testing objectives: "Distinguish between correct and incorrect implementations of the hashcode methods."
I know this is a beta test and early (no study guides for this yet), but can someone guess/theorize what this means?
Originally, I took this to mean that you had to understand the differences in use of hashtable, hashmap and hashset and the appropriate circumstances to use them. (Hashmap/Hashtable fall under the Map implementation, differences are sychronization/non-null for ht, etc. HashSet under the Set interface for element-only based collection allowing a set to have a non-duplicated null element, etc etc.)
Or do we take it literally in that we have to understand/memorize methods of the hash classes?
I guess we'll have to wait to "test the test" to find out.
--
[ April 18, 2002: Message edited by: Toby Davis ]
 
Junilu Lacar
Bartender
Pie
Posts: 7804
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take it to mean Object.hashCode().
Joshua Bloch's book "Effective Java Programming Language Guide" discusses how to correctly implement hashCode.
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a related, older thread on this:
http://www.coderanch.com/t/368118/java/java/Problems-HashSet-fixed-TreeSet
The author you mentioned gives a link to a free chapter that talks about overriding the hashcode() and equals() methods.
Thanks for the initial pointer.
[ April 18, 2002: Message edited by: Toby Davis ]
 
Junilu Lacar
Bartender
Pie
Posts: 7804
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A greenhorn who knows how to Search!! If I could, I'd promote you to ranch hand just for that...
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a bit off-topic... but I saw Joshua Bloch speak at JavaOne -- two of the best sessions I went to. Just for that I'm going to buy his book. If you knew everything in his effective Java book -- you'd be an amazing programmer.
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Jessica, I was there too! I agree, his conference was fantastic.
You can actually download the slides from his presentation at JavaOne from sun's site. You have to register first, but there's no fee.
Here's the link to the slides:
Effective Java Slides
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Junilu Lacar:
A greenhorn who knows how to Search!! If I could, I'd promote you to ranch hand just for that...

One of the sites I run also uses UBB.
I don't have the funds to purchase any books right now (already have RHE, Exam Cram, and several other trusty Java reference books I've used at my jobs in past years)...
Are there any other online resources that get into hashcode() implementations? The keyword is free. (That book chapter did help, though)
---
 
Junilu Lacar
Bartender
Pie
Posts: 7804
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any other online resources that get into hashcode() implementations?
:roll: I knew it was too good to be true... check out
this JavaWorld article
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I have enough ammo to work on this objective. Thanks for the fast replies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic