Better way:
Use a Map with a String representation of the name.
As the values store Lists of magnitudes.
Then you can just do ((List)map.get(name)).add(magnitude) for each record.
You can't increase the size of arrays so using other data structures is a requirement.
As Map and List have what you want why not use them
Reputation Points: 1658
Solved Threads: 331
duckman
Offline 7,719 posts
since Nov 2004