Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

hashmap in java

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class HashhMap {
    public static void main(String[] args){
        Map<String, String> map = new HashMap<>();
        map.put("myName","Kumaran");
        map.put("myProgram", "Java");
        map.put("Designation", "Java Developer");

        Set<String> key = map.keySet();


        for(String keys: key){
            System.out.println(keys+ " : "  +map.get(keys));
        }
    }
}
 
PREVIOUS NEXT
Tagged: #hashmap #java
ADD COMMENT
Topic
Name
6+1 =