Java How do you use the preference API? Where do these variables store?
问题 Say I have the following Preferences prefs = Preferences.userRoot().node(this.getClass().getName()); String ID1 = "Test1"; System.out.println(prefs.getBoolean(ID1, true)); prefs.putBoolean(ID1, false); //prefs.remove(ID1); Is this variable persistent the next time I execute my program? Where do these variables store? What is the proper way of utilizing this? Is the approach better than using properties files? 回答1: Yes, the value is persistent but only for the user. It won't be there for other