Map

Reference:
--5 traversal methods of Maphttp://blog.csdn.net/zhu1qiu/article/details/71170850 --Talk
about
several methods of traversing Map in java
https://www.cnblogs.com/ zhaoguhong/p/7074597.html?utm_source=itdadao&utm_medium=referral
--HashMap simple implementation principle and several ways to traverse map
http://blog.csdn.net/jiangzhongwei_/article/details/51992621

	//traverse map
	public static void main(String[] args) {
		Map<String,String[]> currentMap = new HashMap<String,String[]>();
		String currentString = "";
// currentMap = ...;//Assign currentMap
        Iterator<String> paramIt = currentMap.keySet().iterator();//遍历Map
        int icount = 0;
        while(paramIt.hasNext()){
        	icount ++;
        	String key = paramIt.next();
        	String[] valueArray = currentMap.get(key);
        	String value="";
        	if(valueArray.length>0){
// value=...;//Assign value to value
        	}
        	if(icount == currentMap.size()){
        		currentString += key + "=" + value;
        	}else{
        		//
        	}
        }
	}


Parse the key and value of the map
public class Demo {
	public static void main(String[] args) {
		Map<String, String> startMap=new HashMap<String, String>();
		startMap.put("class1", "There are 30 students in the first grade");
		startMap.put("class2", "There are 31 students in the second grade");
		startMap.put("class3", "There are 28 students in the third grade");
		startMap.put("class4", "4th grade has 29 students");
		Collection<String> coll=startMap.values();
		System.out.println("coll长度="+coll.size());
		for (String value : coll) {
			System.out.println("值value="+value);
		}
		Set<String> set=startMap.keySet();
		System.out.println("set长度="+set.size());
		for (String key : set) {
			System.out.println("键key="+key);
		}
	}
}

Rendering:


[concurrenthashmap]
--ConcurrentHashMap summary
http://www.importnew.com/22007.html
--HashMap and ConcurrentHashMap analysis
https://blog.csdn.net/zldeng19840111/article/details/6703104
--why To use ConcurrentHashMap instead of HashMap
https://blog.csdn.net/l_h_y123/article/details/53330763
-- Analysis of several HashMap/ConcurrentHashMap implementations in Java
http://www.importnew.com/19685.html



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326217534&siteId=291194637
map
Map
Map
map