You can print an array in matrix format by using the following code:
System.out.println ( arr );