Christophe Verré wrote:Are you sure that comparing String values with "==" is right ?
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:Why not return count.hashCode() from your hashCode method? A fixed value is terrible for performance when used with a HashMap or HashSet.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Marriage Made in Heaven
http://www.youtube.com/user/RohitWaliaWedsSonia
Christophe Verré wrote:Also, you are not overriding hashCode. Try to use the @Override annotation on your method to see what happens.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:I'll quote Christophe just because he's 100% right:
Christophe Verré wrote:Also, you are not overriding hashCode. Try to use the @Override annotation on your method to see what happens.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions