Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.prefs.Preferences;

public class Main {
    public static void main(String[] argv) throws Exception {
        boolean exists = Preferences.userRoot().nodeExists("/yourValue"); // false

        Preferences.userRoot().node("/yourValue");

        exists = Preferences.userRoot().nodeExists("/yourValue"); // true

        Preferences prefs = Preferences.userRoot().node("/yourValue");
        prefs.removeNode();

        // exists = prefs.nodeExists("/yourValue");

        exists = prefs.nodeExists(""); // false
    }
}