Here you can find the source of maxtrixPermutation(int beforeArray[][])
public static int[][] maxtrixPermutation(int beforeArray[][])
//package com.java2s; //License from project: Apache License public class Main { public static int[][] maxtrixPermutation(int beforeArray[][]) { int newArray[][] = new int[beforeArray[0].length][beforeArray.length]; for (int i = 0; i < newArray.length; i++) { for (int j = 0; j < newArray[i].length; j++) { newArray[i][j] = beforeArray[j][i]; }//from ww w. j a va 2 s .c o m } return newArray; } }