I try to convert 1D to 2D array, but I keep getting `java.lang.ArrayIndexOutOfBoundsException`, and I have tried whatever I could find on the stackoverflow or internet, but I do not understand why I have this issue? 

```
public class Arrayto2DArray {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int[] a = {0,1, 6, 83, 4, 5, 12, 7};
        int[][] b = new int[4][4];

          for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < b[i].length; j++) {
                 b[i][j]=0;
                 System.out.print(b[i][j]);
            }
            System.out.println();
          }   

        System.out.println("--------------------------");

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < b[i].length; j++) {
                try{
                b[i][j] = a[i+j*4];
                }catch(Exception e){
                    e.printStackTrace();
                    System.out.println(e);
                }
            }
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 4; j++) {
                System.out.print(b[i][j]);
            }
                System.out.println();
        }    
    }
}

```

I kind of know why I get this error and it because of this line

```
 b[i][j] = a[i+j*4];

```

but I cannot come up any formula better than this.