Setting preferences values

suggest change

To store a value into the Preferences node, one of the putXXX() methods is used. A value of a Preferences node can be of the type String, boolean, byte[], double, float, int or long.

Preferences preferences = Preferences.userNodeForPackage(getClass());

preferences.put("someString", "some String value");
preferences.putBoolean("someBoolean", false);
preferences.putByteArray("someBytes", new byte[0]);
preferences.putDouble("someDouble", 187398123.4454d);
preferences.putFloat("someFloat", 298321.445f);
preferences.putInt("someInt", 77637);
preferences.putLong("someLong", 2873984729834L);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents