I'm running AIDE on my Android phone, and am having trouble compiling the following bit of Java code:
elements = Arrays.copyOf(elements, elements.length * 2);
Here elements
is of type int[]
. The error I'm getting from AIDE is
Several methods are applicable to (int[], int): 'java.util.Arrays.copyOf(int[], int)' and 'java.util.Arrays.copyOf<T>(T[], int)'
I would've expected the compiler to pick the former option, but it doesn't. How can I resolve this?