Java Map from Array toMap(Object[][] array)

Here you can find the source of toMap(Object[][] array)

Description

to Map

License

Apache License

Declaration

public static Map toMap(Object[][] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static Map toMap(Object[][] array) {
        Map m = new HashMap();
        for (Object[] pair : array) {
            m.put(pair[0], pair[1]);/*from   w  ww  .  j a  va  2 s.c  om*/
        }
        return m;
    }
}

Related

  1. toMap(Object... pairs)
  2. toMap(Object[] array)
  3. toMap(Object[] array)
  4. toMap(Object[] array, Map map)
  5. toMap(Object[] keys, Object[] values)