File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes HashMap & ArrayList collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HashMap & ArrayList collections" Watch "HashMap & ArrayList collections" New topic

HashMap & ArrayList collections

Iain Linton

Joined: Jan 24, 2006
Posts: 21
I have:

I have a Class Member

my question is:

how do I get a member to join a trip (both the Member and Trip should be paremeters)

Do I have to convert the HashMap into a collection and iterate over it to get the trip code, also iterate over the ArrayList to get the member then join the on the trip.

The question is how?

All help would be greatly appreciated
marc weber

Joined: Aug 31, 2004
Posts: 11343

I think you need to give us more information about what it means for a Member to "join" a Trip. Also, what exactly is in the HashMap (what are the key/value pairs)? And what is a "trip code"?

Or better yet, what have you tried, and what went wrong?
[ March 14, 2006: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
ak pillai
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
What do you have in your List and what do you have in your Map.

You will have to use an iterator to iterate through either.

java j2ee job interview questions with answers | Learn the core concepts and the key areas
I agree. Here's the link:
subject: HashMap & ArrayList collections
It's not a secret anymore!