You cannot "deactivate" variables as you describe / wish.
However, if you construct the block structure correctly, you can arrange for certain variables to be unavailable; eg.
String input = .... { String pass1 = op1 (input); ... } String pass2 = op2 (pass1);
It is unclear whether this gives you sufficient control to achieve what you are really trying to do. But if I don't think about any alternatives that will work at compile time ...
Reusing the variables described in @Joshua is a different approach. This avoids the problem, rather than solving it directly.
source share