single Key Map - Android java.util

Android examples for java.util:Map

Description

single Key Map

Demo Code


//package com.book2s;
import java.util.HashMap;
import java.util.Map;

public class Main {
    public static <K, V> Map<K, V> singleKeyMap(K key, V value) {
        Map<K, V> ret = new HashMap<K, V>();
        ret.put(key, value);/*w w w.  ja  va2s .  c om*/
        return ret;
    }
}

Related Tutorials