is there limit number of elements java array can contain? if so, it?
haven't seen right answer, though it's easy test.
in recent hotspot vm, correct answer integer.max_value - 5. once go beyond that:
public class foo { public static void main(string[] args) { object[] array = new object[integer.max_value - 4]; } } you get:
exception in thread "main" java.lang.outofmemoryerror: requested array size exceeds vm limit
Comments
Post a Comment