Here you can find the source of putPrefsStrings(Preferences prefs, String key, String[] strings)
public static void putPrefsStrings(Preferences prefs, String key, String[] strings)
//package com.java2s; import java.util.prefs.Preferences; public class Main { public static void putPrefsStrings(Preferences prefs, String key, String[] strings) { for (int i = 0; i < strings.length; i++) prefs.put(key + (i + 1), strings[i]); for (int i = strings.length; prefs.get(key + (i + 1), null) != null; i++) prefs.remove(key + (i + 1)); }//from w ww .j ava 2s. co m }