aspose file tools*
The moose likes Beginning Java and the fly likes 2-dim array or vectors solution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "2-dim array or vectors solution" Watch "2-dim array or vectors solution" New topic
Author

2-dim array or vectors solution

Gary Frick
Greenhorn

Joined: Sep 13, 2002
Posts: 28
I need to store and run a tab on a list of items. The purpose is to do a running tally of a given item as the items present themselves. For example, If I were do a query selecting all fruit. I then need to tally up how many kinds of fruit were returned. So the 1st value is the type of fruit, and the second is a running count that gets incremented. Which mechanisam (arrays or vectors) are better suited for this? And how do I implement so that I have one entry of each type of fruit and then can update the second dimension that is the running count?
Most appreciative,
Gary
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Sounds like a job for Map
Gary Frick
Greenhorn

Joined: Sep 13, 2002
Posts: 28
Java Ranch is the best. Dave, you taught me something new. MAP is just what I need. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 2-dim array or vectors solution