Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: need help with a basic program
|
Posted: Mar 20, 2002 5:52 PM
|
|
This is a good application for practicing using a Map. Use each new value as a key in a HashMap; if it is not already there, initialize it to new Integer(1), if it is already there, increment its value (well, you can't really increment an Integer, since it is immutable, but you'd get its value and store a new Integer value there that is one greater). At the end, just iterate through the map and display the results.
|
|