int[][] A = {{11, 7},{-20,-22}};
int[][] B = {{A[0].length},{A.length}};
for(int i = 0; i < A.length;i ++){
for(int j = 0; j < A[0].length;j ++){
System.out.print(A[i][j] + "\t");
}
System.out.println();
}
for(int i = 0; i < A.length;i ++){
for(int j = 0; j < A[0].length;j ++){
B[i][j] = A[j][i];
}
}
O erro é este :
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 at j.pkg1.J1.ex31(J1.java:132) C:\*******************************\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)
A linha 132 é B[i][j] = A[j][i];
A[j][i]
do array, não existe.