This week's book giveaway is in the
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
Java in General
hashtable working & overriding equals()
Joined: Feb 26, 2005
Mar 22, 2005 01:01:00
thanx for the tremendous response for clearing my earlier doubt in string-pool.expecting similar responses from u all,i m posting yet another question and its regarding hashtable working.
we know that hashtable stores values as key/value pairs,where both key and value should b an object.
considering this code,
public static void main(
car ob1=new car();
car ob2=new car();
Hashtable hs=new Hashtable();
}//end of main
}// end of class car
now the o/p obtained is Rahi.i understand why is it so.as i have reffered the key ob1 for Rahi at last.
i want to know how the hashtable retreives the data,and how can i override equals() method,so that key/value pair is unique.
please give thw way as how i should override the equals() method to make my code more efficient.
author and iconoclast
Joined: Jul 08, 2003
Mar 22, 2005 05:20:00
Please don't post
It just wastes people's time if they answer a question that's already been answered elsewhere. I'm closing this one.
[Jess in Action]
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: hashtable working & overriding equals()
hashtable working & overriding equals
a doubt in equals() method
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013