Removing a Preference from a Preference Node

This section demonstrates you to remove the preference from a preference node.

Removing a Preference from a Preference Node

     

This section demonstrates you to remove the preference from a preference node. You can see in the given example that in order to remove the preference from the Preference node 'Roseindia', we have used the method clear() of class Preference which removes all of the preferences (key-value associations) from the preference node.

Here is the code of RemovePreference.java

import java.util.prefs.*;
public class RemovePreference{
public static void main(String[] args) throws Exception{
 Preferences prefs = Preferences.userRoot().node("/Roseindia");
 prefs.clear();
 }
}

Download Source Code:

Advertisements

Ads
Share on Google+Share on Google+

Removing a Preference from a Preference Node

Posted on: January 7, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Removing a Preference from a Preference Node  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads