Java program to find transpose of a matrix