int [][] matA = {{1,2,3},{3,4,5}};
int [][] matB = {{3,4,5},{1,4,2}};
int [][] mulMat = new int[matA.length][matA[0].length];
for(int i=0; i<matA.length;i++){
for(int j=0; j<matA[i].length; j++){
mulMat[i][j] = matA[i][j] * matB[i][j];
System.out.printf("%d ",mulMat[i][j]);
}
System.out.println("");
}
System.out.println("");
int[][] matA_ = new int[matA[0].length][matA.length];
for(int i = 0 ; i < matA.length; i++){
for (int j = 0; j < matA[0].length;j++){
matA_[j][i] = matA[i][j];
}
System.out.println("");
}
for(int[] array: matA_){
for(int val : array){
System.out.printf("%d ",val);
}
System.out.println("");
}
}
}