Java Map Create createMap(Object[] keysValues)

Here you can find the source of createMap(Object[] keysValues)

Description

create Map

License

Open Source License

Declaration

public static Map createMap(Object[] keysValues) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static Map createMap(Object[] keysValues) {
        Map ret = new HashMap();

        for (int i = 0; i < keysValues.length; i = i + 2) {
            ret.put(keysValues[i], keysValues[i + 1]);
        }/* w  w w .j a v  a2s. co  m*/

        return ret;
    }
}

Related

  1. createMap(Map map)
  2. createMap(Object keys[], Object values[])
  3. createMap(Object... args)
  4. createMap(Object... objects)
  5. createMap(Object... objects)
  6. createMap(String entries)
  7. createMap(String key, Object value)
  8. createMap(String[] list1, String[] list2)
  9. createMap(String[] mappings, String sep)