Here you can find the source of matrixTranspose(Object[][] matrix)
public static Object[][] matrixTranspose(Object[][] matrix)
//package com.java2s; //License from project: Open Source License public class Main { public static Object[][] matrixTranspose(Object[][] matrix) { if (null == matrix) { return null; }/*from w ww.j av a 2 s .c o m*/ Object[][] matrixT = new Object[matrix[0].length][matrix.length]; for (int i = 0; i < matrix[0].length; i++) { for (int j = 0; j < matrix.length; j++) { matrixT[i][j] = matrix[j][i]; } } return matrixT; } }