Is there any way to update values globally? More specifically, boolean value. I'm trying to make a subroutine that "toggles" the given value, but it only does it locally. I've also tried hashmaps, but that's local also. Here' the test code I came up with:import java.util.Map; import java.util.HashMap; public class booltest { private static boolean isFalse = false; public static boolean isTrue = true; public static Map<String, Boolean> settings = new HashMap(); public static void main (String args[]){ settings.put("Test", false); System.out.println(String.valueOf(settings.get("Test"))); toggleOnOff("Test"); System.out.println(settings.get("Test")); toggleOnOff("Test"); System.out.println(String.valueOf(settings.get("Test"))); hashmaptest(); } private static void toggleOnOff(String Value){ if (settings.get(Value).equals(isFalse)) settings.put(Value, true); if (settings.get(Value).equals(isTrue)) settings.put(Value, false); } private static void hashmaptest(){ Map<String, Boolean> test =new HashMap(); test.put("test", false); System.out.println(String.valueOf(test.get("test"))); test.put("test", true); System.out.println(String.valueOf(test.get("test"))); test.put("test", false); System.out.println(String.valueOf(test.get("test"))); } }