Answers for "how to put in map java"

3

java add to map

HashMap<String, String> map = new HashMap<>();
map.put("key", "value");
Posted by: Guest on January-12-2021
0

map.put in java

import java.util.*;
public HashMap{
    public static void main(String[] args){
        Map<Integer, String> map = new HashMap<>();//initialization of HashMap 
        map.put(key, value);//key and value must be entered
        System.out.println(map);
    }
}
Posted by: Guest on May-21-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language