public static int transpose(int[][] matrix, int a, int b)
{
int a, b, c, d;
.....
}

See the bold parts for where you have declared them.