Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Add Hastable obj to a Vector? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Add Hastable obj to a Vector?" Watch "Add Hastable obj to a Vector?" New topic
Author

Add Hastable obj to a Vector?

Nils Persson
Greenhorn

Joined: May 25, 2001
Posts: 21
Is it possible to add Hashtable objects to an Vector, and the iterate through the Vector and retrieve the Hashtable value/key pairs?
I've tried with this:
Robert Ziel
Greenhorn

Joined: Apr 22, 2002
Posts: 28
hi nils,
a vector is used for storing objects
Hashtable is an object so i see no reason why
this should give any trouble..
when your want to use the hashtable you have to cast it back to a hashtable object..

Robert
Craig Lewis
Greenhorn

Joined: May 14, 2002
Posts: 11
Nils,
You don't want to use final as a varible name - it's a reserved word.
You need to iterate through the vector then iterate through the hashtable


Craig
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Add Hastable obj to a Vector?
 
Similar Threads
stackoverflow cloning hashtable
Hash Table - Sorting
HELP required in my assignment
want to make a table~~~
getting the int value