Share on Google+Share on Google+

Retrieving a Preference Node

This page discusses - Retrieving a Preference Node

Retrieving a Preference Node


This section demonstrates you to retrieve a Preference node. You can see in the given example that we have used an absolute path in order to get the Preference node. The absolute paths begin with '/'. The method name() returns the preference node's name, with respect to the absolute path.

Here is the code of

 import java.util.prefs.*;

  public class RetrievingNodes{
  public static void main(String[]args){
  Preferences prefs = Preferences.userRoot().node("/Roseindia");

Output will be displayed as:

Download Source Code



Posted on: April 17, 2011 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: Retrieving a Preference Node  

Post your Comment

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