Top "Arraylist" questions

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

Initialization of an ArrayList in one line

I wanted to create a list of options for testing purposes. At first, I did this: ArrayList<String> …

java collections arraylist initialization
Convert ArrayList<String> to String[] array

I'm working in the android environment and have tried the following code, but it doesn't seem to be working. String [] …

java arrays arraylist
Create ArrayList from array

I have an array that is initialized like: Element[] array = {new Element(1), new Element(2), new Element(3)}; I would like to …

java arrays arraylist type-conversion
Best way to convert an ArrayList to a string

I have an ArrayList that I want to output completely as a String. Essentially I want to output it in …

java string arraylist
When to use LinkedList over ArrayList in Java?

I've always been one to simply use: List<String> names = new ArrayList<>(); I use the interface …

java arraylist collections linked-list
How to sort an ArrayList?

I have a List of doubles in java and I want to sort ArrayList in descending order. Input ArrayList is …

java sorting arraylist collections
How do I remove repeated elements from ArrayList?

I have an ArrayList<String>, and I want to remove repeated strings from it. How can I do …

java list collections arraylist duplicates
How to get the last value of an ArrayList

How can I get the last value of an ArrayList? I don't know the last index of the ArrayList.

java arraylist
Convert list to array in Java

How can I convert a List to an Array in Java? Check the code below: ArrayList<Tienda> tiendas; …

java arrays list arraylist
Converting 'ArrayList<String> to 'String[]' in Java

How might I convert an ArrayList<String> object to a String[] array in Java?

java arrays string arraylist collections