Hash Mapper

package hashmapper;

import java.util.HashMap;

/**
 *
 * @author Nurhak
 */
public class HashMapper {

    private static HashMap hm = new HashMap();
    private static String numbers[][] = {
        {"1", "a"},
        {"2", "b"},
        {"3", "c"},
        {"4", "d"},
        {"5", "e"}
    };

    public static void findValue(String key) {
        System.out.println("-->" + hm.get(key));
    }

    public static void main(String[] args) {

        for (int i = 0; i < numbers.length; i++) {
            hm.put(numbers[i][0], numbers[i][1]);
        }

        findValue("1");
        findValue("3");
        findValue("5");

        System.out.println(hm);

    }
}

Comments

Popular posts from this blog

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Solution for "Can not obtain Oracle client information from registry"