Java HashMap Create hashMapRange(int upTo)

Here you can find the source of hashMapRange(int upTo)

Description

hash Map Range

License

Open Source License

Declaration

public static HashMap<String, String> hashMapRange(int upTo) 

Method Source Code


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

import java.util.HashMap;

public class Main {
    public static HashMap<String, String> hashMapRange(int upTo) {
        HashMap<String, String> h = new HashMap<>(upTo);
        for (int i = 0; i < upTo; i++) {
            h.put("k" + i, "v" + i);
        }/*  w  w w  .j  a  v  a2  s .  co  m*/
        return h;
    }
}

Related

  1. hashMap()
  2. hashmap()
  3. hashMap(Entry... entries)
  4. hashMap(Entry... entries)
  5. hashMap(Object... kvs)
  6. newHashMap( Map map)
  7. newHashMap()
  8. newHashMap()
  9. newHashMap()