Is there a limit to the number of elements a Java array can contain? If so, what is it?
Maximum number of elements of an array is (2^31)−1 or 2 147 483 647
array
(2^31)−1
2 147 483 647