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");
        if (!exists) {
            Preferences prefs = Preferences.userRoot().node("/yourValue");
            prefs.removeNode();
            // prefs.removeNode();
        }
        Preferences prefs = Preferences.userRoot().node("/yourValue/child");
        exists = Preferences.userRoot().nodeExists("/yourValue");
        exists = Preferences.userRoot().nodeExists("/yourValue/child");

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

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