Could someone translate the following C++ code into Java?
void printAllPathsUtil(int *mat, int i, int j, int m, int n, int*path, int pi)
{
// Reached the bottom of the matrix sowe are left with
// only option to move right
if (i == m – 1)
{
for (int k = j;k < n; k++)
path[pi+ k – j] = *((mat + i*n) + k);
for (int l = 0;l < pi + n – j; l++)
cout<< path[l] << ” “;
cout <<endl;
return;
}
// Reached the right corner of thematrix we are left with
// only the downward movement.
if (j == n – 1)
{
for (int k = i;k < m; k++)
path[pi+
PayPal Gateway not configured
PayPal Gateway not configured