File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Collection

 
Chris Chua
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 388
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic