Home Java Example Java Util Retrieving a Preference Node



Retrieving a Preference Node
Posted on: April 17, 2011 at 12:00 AM
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 RetrievingNodes.java

 import java.util.prefs.*;

  public class RetrievingNodes{
  public static void main(String[]args){
  Preferences prefs = Preferences.userRoot().node("/Roseindia");
  String p=prefs.name();
  System.out.println(p);
  }
  }

Output will be displayed as:

Download Source Code

Related Tags for Retrieving a Preference Node :


More Tutorials from this section

Ask Questions?    Discuss: Retrieving a Preference Node  

Post your Comment


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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.