Q:

Wrong Result Once I process try and catch

I wanted to check try and Catch in Java
my code
public class tester {

public static void main (String arg[]){

int[] hi = new int[3];
try{
for(int i = 0; i<5; i++){
hi[i] = i;
}
System.out.println(hi);
}
catch(ArrayIndexOutOfBoundsException e){

    System.out.println("wronnnnnng");

}

}
}

and it works without problem but once I change the array index to make it larger like 5
I should see from 0 to 4 but I just see random numbers?
public class tester {

public static void main (String arg[]){

int[] hi = new int[5];
try{
for(int i = 0; i<5; i++){
hi[i] = i;
}
System.out.println(hi);
}
catch(ArrayIndexOutOfBoundsException e){

    System.out.println("wronnnnnng");

}

}
}

and as result I got [I@3343c8b3? why?

A:

When you fix your program to no longer throw an exception, it reaches the 
System.out.println(hi);

line. However, since int[] array does not override toString, it calls the default toString of java.Object, which prints arbitrary numbers.
As a matter of exercise, consider writing a loop that prints these numbers. You could also use Arrays.toString.

