tag:blogger.com,1999:blog-694855878384792308.post6185433342648511565..comments2024-03-21T06:26:49.387-07:00Comments on Java67: How to convert an Array to Collection like Set and List in Java? Example Tutorial javin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-694855878384792308.post-53899414331958103972014-12-15T20:38:18.935-08:002014-12-15T20:38:18.935-08:00Many Collections are actually wrapper over array, ...Many Collections are actually wrapper over array, for example ArrayList is backed up by an array, Hashtable, HashMap uses array as bucket etc. Main reason of array's popularity is the contant time retrieval of element if you know the index. All these data structure either ask for index or first find index then locate element. You can even use array to create your own data structure, e.g. Circular buffer, similar to what Disrupter team has created for LMAX exchange. Gautamnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-33758299589115132722013-07-16T02:09:23.422-07:002013-07-16T02:09:23.422-07:00I just surprise that sometime for trivial task lik...I just surprise that sometime for trivial task like this, I need to do google search. Thanks dude, it certainly helps. I have one question though, when do you prefer to use Array over Collection? It seems Collections are lot better than array, as they are dynamic, they resize automatically, it's easy to add and remove objects from Collection.Anonymousnoreply@blogger.com