Java Map from Array map(Object... oo)

Here you can find the source of map(Object... oo)

Description

map

License

Open Source License

Declaration

public static Map map(Object... oo) 

Method Source Code

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

import java.util.*;

public class Main {
    public static Map map(Object... oo) {
        Map result = new HashMap();
        for (int i = 0; i < oo.length; i += 2)
            result.put(oo[i], oo[i + 1]);
        return result;
    }/*from  w  ww. j  a v  a 2s .  com*/

    public static <K, V> Map<K, V> map() {
        return new HashMap<K, V>();
    }
}

Related

  1. map(Object... objects)
  2. map(Object... objects)
  3. map(Object... objects)
  4. map(Object... objs)
  5. map(Object... objs)
  6. map(Object... params)
  7. map(String k, Object v)
  8. map(String key, String val)
  9. map(String... args)