When it comes to which is better, the best option is to write using both options, then profile it, as which is better is context-dependent.
By profiling that application the OP can find the best option for his use, and have the numbers to back it up. If you know how many items you are going to have in a collection, for example, then the arraylist is obviously the better choice. If you are adding/removing frequently then it won't be the best choice. I tend to use an arraylist, since I read often from my preferences, and can split up the string that is stored there, so I know how many items to store. On Sun, Dec 18, 2011 at 11:28 AM, Lew <[email protected]> wrote: > Based on what? We have zero facts on which to base such a baseless > conclusion. > > The consensus of the referenced reference seems to be the opposite of your > conclusion, > though it is equally devoid of context-relevant data for the OP. The > point being that it > doesn't support your inference. > > So how did you decide that 'LinkedList' is "better" for the OP? Did they > write you > privately with more data? > > Did I perhaps misunderstand your post? > > -- > Lew > > On Sunday, December 18, 2011 5:43:41 AM UTC-8, Michael Leung wrote: >> >> That sounds Linked List better! >> > > >> On Sun, Dec 18, 2011 at 11:34 PM, Mark Murphy <[email protected]>wrote: >> >>> http://stackoverflow.com/**questions/322715/when-to-use-** >>> linkedlist-over-arraylist<http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist> >>> >>> >>> On Sun, Dec 18, 2011 at 8:27 AM, bob <[email protected]> wrote: >>> > Let's say you are making a game for Android. You want a container to >>> > store the list of enemy ships… maybe a linked list… maybe an array. >>> > >>> > Which is probably better? LinkedList or ArrayList? Or, is there >>> > something I haven't thought about that's better than those two? >>> > >>> > I would think LinkedList would be better in theory, but I saw >>> > ArrayList being used in this Android game book I bought… Beginning >>> > Android Games. >>> >> > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- "I know that you believe you understand what you think I said, but I'm not sure you realize that what you heard is not what I meant." - Robert McCloskey -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

