How to create ArrayList from Array in Java
The problem
If you have a traditional array, that looks something like the following:
|
|
And you would like to convert this to an ArrayList:
|
|
..then you can do the following!
The solution
The technique
|
|
How to use it
Of course you could always simplify this one further directly as:
|
|
How to old Java
If you are stuck in the old world of Java, you can fall back to:
|
|