Top "Arraylist" questions

A simple collection data type found in some languages / platforms (such as in Java or .NET).

Variable length (Dynamic) Arrays in Java

I was wondering how to initialise an integer array such that it's size and values change through out the execution …

java arrays dynamic arraylist
How to convert a String into an ArrayList?

In my String, I can have an arbitrary number of words which are comma separated. I wanted each word added …

java string arraylist converter
Why do I get an UnsupportedOperationException when trying to remove an element from a List?

I have this code: public static String SelectRandomFromTemplate(String template,int count) { String[] split = template.split("|"); List<String> …

java exception list arraylist
How to avoid "ConcurrentModificationException" while removing elements from `ArrayList` while iterating it?

I'm trying to remove some elements from an ArrayList while iterating it like this: for (String str : myArrayList) { if (someCondition) { …

java list arraylist iterator
What is the difference between ArrayList.clear() and ArrayList.removeAll()?

Assuming that arraylist is defined as ArrayList<String> arraylist, is arraylist.removeAll(arraylist) equivalent to arraylist.clear()? If …

java arraylist
How to convert an ArrayList containing Integers to primitive int array?

I'm trying to convert an ArrayList containing Integer objects to primitive int[] with the following piece of code, but it …

java arrays arraylist primitive-types
ArrayIndexOutOfBoundsException when using the ArrayList's iterator

Right now, I have a program containing a piece of code that looks like this: while (arrayList.iterator().hasNext()) { //value …

java arraylist iterator indexoutofboundsexception
Save ArrayList to SharedPreferences

I have an ArrayList with custom objects. Each custom object contains a variety of strings and numbers. I need the …

android arraylist sharedpreferences
ArrayList vs List<> in C#

What is the difference between ArrayList and List<> in C#? Is it only that List<> has …

c# .net list generics arraylist
Java: how can I split an ArrayList in multiple small ArrayLists?

How can I split an ArrayList (size=1000) in multiple ArrayLists of the same size (=10) ? ArrayList<Integer> results;

java arraylist