File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
HashMap & ArrayList collections
Joined: Jan 24, 2006
Mar 14, 2006 15:10:00
private HashMap allTrips = new HashMap(); private ArrayList allMembers = new ArrayList();
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
into a collection and iterate over it to get the trip code, also iterate over the
to get the member then join the on the trip.
The question is how?
All help would be greatly appreciated
Joined: Aug 31, 2004
Mar 14, 2006 15:45:00
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
(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."
Joined: Feb 11, 2006
Mar 15, 2006 01:44:00
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
Ordered and Sorted
Retrieving values from a HashMap
using c:forEach to iterate over Map<String, ArrayList<Hashmap>>
Looping over nested list
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015