This is my code, it should work, but when i transpose and print matrix, it outputs the same matrix, not transposed. Some explanation? It should change the matrix, not make copy and transpose then return. public void transpose(){
for(int i=0;i<n;i++)
for(int j=0;j<m;j++){
Object tmp=matrix[i][j];
matrix[i][j]=matrix[j][i];
matrix[j][i]=tmp;
}
}