package com.day15.Map;

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

public class MapFive {

  public static void main(String[] args) {
    Map<String, Integer> ma=new HashMap<>();
    ma.put("Kobe",20);
    ma.put("KG",21);
    ma.put("PP",22);
    ma.put("Allen",23);
    for(Map.Entry<String,Integer> en:ma.entrySet()){
      System.out.print(en.getKey()+"="+en.getValue());//PP=22Kobe=20KG=21Allen=23
    }
  }

}

相关文章:

  • 2022-01-19
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-12-18
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案