Share on Google+Share on Google+

Removing a Preference Node

This section demonstrates you to remove the Preference node

Removing a Preference Node


This section demonstrates you to remove the Preference node. You can see in the given example that firstly you have to get the specified node using the method userRoot().node("/Roseindia Employees") method. Then use the removeNode() method of Preferences class which removes this preference node and all of its descendants, invalidating any preferences contained in the removed nodes.

Here is the code:

import java.util.prefs.*;
public class RemoveNode{
  public static void main(String[] args)throws IOException, BackingStoreException {
  Preferences prefs = Preferences.userRoot().node("/Roseindia Employees");

Download Source Code:



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

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.

Discuss: Removing a Preference Node  

Post your Comment

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