if the function should not accept parameters and should not reference the non-local variables
You are at a dead end with these two unless you want to use class variables, ie, variables with the static modifier. But these too are not local variables.
The usual way that we preserve state is to use member variables.
class Pseudo {
// Member variables with class scope.
int x = 25;
int y = 40;
// Class variables.
static int z = 99;
static int v = 2;
public void modifyVariables() {
x += 25;
y += 10;
z -= 12;
v += z;
System.out.printf("x = %d y = %d z = %d v = %d%n",
x, y, z, v);
}
}