int[][] number = {{1,2,3},{4,5,6},{7,8,9}};
int[][] newnumber = new int[number[0].length][number.length];
for(int i = 0;ifor(int j = 0;j newnumber[i][j] = number[j][i];
}
}
System.out.println("This is new Array");
for(int i = 0;ifor(int j = 0;j System.out.print(newnumber[i][j]+" ");
}
System.out.println("");
}
System.out.println("This is old Array");
for(int i = 0;ifor(int j = 0;j System.out.print(number[i][j]+" ");
}
System.out.println("");
}