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("someKey", "...