Tag: arraylist

63 votes
30 answers
2.2K views
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> plac

avatar
Dorian
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
922 views
When to use LinkedList over ArrayList in Java?

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

avatar
Sena
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
343 views
Create ArrayList from array

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

avatar
Margo
0 1 0 9
asked 07 September, 2021