Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

public class Main {
    public static void main(String[] argv) throws Exception {
    }

    public static String containsValue(Preferences node, String value) {
        try {
            String[] keys = node.keys();

            for (int i = 0; i < keys.length; i++) {
                if (value.equals(node.get(keys[i], null))) {
                    return keys[i];
                }
            }
        } catch (BackingStoreException e) {
        }
        return null;
    }
}