Top "Arraylist" questions

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

Why start an ArrayList with an initial capacity?

The usual constructor of ArrayList is: ArrayList<?> list = new ArrayList<>(); But there is also an overloaded …

java data-structures arraylist capacity
Concurrent threads adding to ArrayList at same time - what happens?

We have multiple threads calling add(obj) on an ArrayList. My theory is that when add is called concurrently by …

java concurrency synchronization arraylist
ArrayList Vs LinkedList

I was following a previous post on this that says: For LinkedList get is O(n) add is O(1) remove …

java data-structures collections arraylist linked-list
Concurrent Modification Exception : adding to an ArrayList

The problem occurs at Element element = it.next(); And this code which contains that line, is inside of an OnTouchEvent …

java android exception arraylist iteration
Java Arraylist to store user input

Hi I am new to arraylists and java and I was wondering if someone could help me or give me …

java arrays arraylist user-input storing-data
Java convert Arraylist<Float> to float[]

How I can do that? I have an arraylist, with float elements. (Arraylist <Float>) (float[]) Floats_arraylist.toArray() …

java arrays casting arraylist autoboxing
Reverse iteration through ArrayList gives IndexOutOfBoundsException

When I reverse iterate over an ArrayList I am getting a IndexOutOfBoundsException. I tried doing forward iteration and there is …

java arraylist iteration reverse
JavaFX, Casting ArrayList to ObservableList

Is there a way to cast ArrayList to ObservableList? I would like to do it without iterating through ArrayList. To …

java arraylist javafx ormlite observablelist
filtering an ArrayList using an object's field

I have an ArrayList which is filled by Objects. My object class called Article which has two fields ; public class …

java arraylist filtering guava
what is the sense of final ArrayList?

Which advantages/disadvantages we can get by making ArrayList (or other Collection) final? I still can add to ArrayList new …

java arraylist final