What is the fastest way to get the first n elements of a list stored in an array?
Considering this as the scenario:
int n = 10; ArrayList
It mostly depends on how big n is.
n
If n==0, nothing beats option#1 :)
n==0
If n is very large, toArray(new String[n]) is faster.
toArray(new String[n])