Java Programing laungage

java.util Projects

java.util Project 1

Using put() method

In this page of the tutorials we are going to learn that how a put() method is used in the program, in this example first time when it initialize it do not have any value but when we give some of the value in it by put() function then it will show the value what it have in its container.

Previous Home Next

Example


package r4r;
import java.util.*;
import java.util.prefs.Preferences;
public class putmethodtest {
public static void main(String[] args)
 {



Preferences pre = Preferences.userNodeForPackage(putmethodtest.class);
String str = pre.get("one", " ");
System.out.println(str);
pre.put("one", "Techsoft solution");
  }
}

Previous Home Next