tag:blogger.com,1999:blog-694855878384792308.post93495624943168283..comments2024-03-21T06:26:49.387-07:00Comments on Java67: Difference between ArrayList and HashMap in Javajavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-694855878384792308.post-33309001901590780242016-01-13T04:42:33.962-08:002016-01-13T04:42:33.962-08:00Hello @Prachi, if you just want to store an object...Hello @Prachi, if you just want to store an object than use ArrayList, if you have a mapping e.g. a key and a value like emp_id mapped to Employee object than use HashMap. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-8673607625264468752016-01-12T10:17:50.143-08:002016-01-12T10:17:50.143-08:00Which one is better for storing and retrieval?Which one is better for storing and retrieval?prachihttps://www.blogger.com/profile/16299833586088100505noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-53316426837342877522015-09-13T20:35:30.179-07:002015-09-13T20:35:30.179-07:00@Anonymous, that's the difference and aticle s...@Anonymous, that's the difference and aticle says diference between ArrayList and HashMap. To add on that there are couple of others, which are worth noting :<br />1) HashMap has load factor to decide when to resized but ArrayList doesn't have load factor. Capacity is checked when you add element using add() method and ArrayList is incresed by 50% or big enough to hold new elements along with old elements if resize happens.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-49200539223357561462014-09-09T00:38:15.067-07:002014-09-09T00:38:15.067-07:00on use index and one use key so both are order spe...on use index and one use key so both are order specific so....both r n same category bt as speed point of view as arraylist requires less size its quit better than hash mapAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-52047354584534119392012-11-01T02:22:14.653-07:002012-11-01T02:22:14.653-07:00How can you compare ArrayList with HashMap both ar...How can you compare ArrayList with HashMap both are different kinds of data structure , Map holds two objects e.g. key and value while List only holds one object and that is data.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-76526087099831042172012-09-25T01:34:48.861-07:002012-09-25T01:34:48.861-07:00What is performance comparison on HashMap vs Array...What is performance comparison on HashMap vs ArrayList. I mean if I want to retrieve an object whose index in ArrayList is known and key in HashMap is known, which one will be faster. How about addition time over long period ?Anonymousnoreply@blogger.com