File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Collection" Watch "Collection" New topic
Author

Collection

Chris Chua
Greenhorn

Joined: Feb 21, 2001
Posts: 24
Hi I wanted to store set of information like employee number, employee name, and employee address what class in the collection framework do i have to use so that when i search on the employee number, it would give me the employee name and address, could somebody pls help me with some code.
Thanks
Chris
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi,
did you try Hashtable in java.util ?
it takes a key and a value (your key would be the number, the value the name)

karl
Chris Chua
Greenhorn

Joined: Feb 21, 2001
Posts: 24
yes i used Hashtable the employee num is the key and the name is the value but how about the employee add?
Chris
Nisha Siddiqui
Greenhorn

Joined: Jun 07, 2001
Posts: 5
You could maybe have a Hashtable which holds another Hashtable as its value, with name and address?
It is however expensive to create so many hashtables!
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Or you could create an Employee class that holds all this information, and then make a HashTable of Employees, using their number as the key...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Collection