October 2, 2009 at 12:25 PM
When your application demands saving the objects then ArrayList can be used. But if you need to retrieve the objects more often then HashMap is preferable.This is the basic diff. Aray-List is fast for storing and hashmap is fast for retrieving. If your application needs both storing and retrieving at same no. of times then u can Arraylist for storing and hashmap for the latter purpose.