File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Add Hastable obj to a Vector?

Nils Persson

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

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..

Craig Lewis

Joined: May 14, 2002
Posts: 11
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

I agree. Here's the link:
subject: Add Hastable obj to a Vector?
jQuery in Action, 3rd edition