Here you can find the source of clearPreference(Object context)
public static void clearPreference(Object context)
//package com.java2s; //License from project: Open Source License import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; public class Main { private static Preferences prefs; public static void clearPreference(Object context) { try {/*from ww w . j ava 2s . c o m*/ prefs = Preferences.userRoot().node(context.getClass().getName()); prefs.clear(); } catch (BackingStoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }