Try this:
int array[] = new int[5];
for (int i = 0; i < 6; i++) {
try{
array[i] = i+10;
}catch(java.lang.ArrayIndexOutOfBoundsException ex){
System.out.println("Exception: Array limit exceeded.");
}
}
EDIT: working and forum browsing don't mix - not 100% if this will fix your problem... there also seems to be extra curly braces, so note - I haven't tried this yet.
EDIT: Sorry, that'll be the last time I don't pay attention... - it appears you're not catching the correct exception, so catch it.
