HashMap问题

package com.google;

import javax.lang.model.element.NestingKind;
import java.util.HashMap;

public class IntegerDemo {
    public static void main(String[] args) {
        HashMap hashMap = new HashMap();
        hashMap.put("name","123");
        hashMap.put("name","1234567");
        hashMap.put("name",null);
        hashMap.put("name","123");
        System.out.println(hashMap.size());// 1
        System.out.println(hashMap.get("name"));//123
    }
}

  

posted @ 2022-11-25 16:11  Sunray0330  阅读(18)  评论(0编辑  收藏  举报