Rat in a maze Java

I just want to print the last possible path, but my code is returning all possible paths.
What should I change?

Hi Aman,
In this question there will be only two recursive call one rightward and second downward. Also any cell of solution matrix will be 1 when any one of the two call returns true. If none call returns true then that cell of solution matrix will be 0 and finally return false.