HashMap in Java

Source code :

import java.util.HashMap;

public class CodeCry{
    public static void main(String[ ] args) {
        HashMap<String, Integer>
         points = new HashMap<String,Integer>();
        points.put("Amy", 20);
        points.put("Dave", 21);
        points.put("Rob", 23);
        System.out.println(points.get("Dave")); 
    
    }
}

Output :

21

Output :


                

Comments :