Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Example Java Util Removing a Preference from a Preference Node

Related Tutorials


 
 

Share on Google+Share on Google+

Removing a Preference from a Preference Node

Advertisement
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

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 7, 2009

Related Tutorials

Discuss: Removing a Preference from a Preference Node  

Post your Comment


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