what's the max size you can put in an array?

when declaring an array,, i wonder if there's a limit or a maximum length you can use for array?

ex.:

int n[] =newint[what's the max length for this?];

JButton b[] =new JButton[what's the max length for this?];

thanks!!!

[442 byte] By [angeles1016a] at [2007-10-1 1:54:05]
# 1
Theoretically the maximum size of an array will be Integer.MAX_VALUE,practically it all depends on how much memory you gave to your VM and howmuch of that has already been allocated to other objects ...kind regards,Jos
JosAHa at 2007-7-8 8:16:32 > top of Java-index,Security,Event Handling...
# 2
Multipost http://forum.java.sun.com/thread.jspa?threadID=584447 http://forum.java.sun.com/thread.jspa?threadID=584445 http://forum.java.sun.com/thread.jspa?threadID=584443
jverda at 2007-7-8 8:16:32 > top of Java-index,Security,Event Handling...