package facadeTest.mapTest;

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

/**
 * 在map中放入数据时,如果key相同,会替换掉之前的相同key的数据
 */
public class MapTiHuan {
	public static String test(Map<String, String> param) {

		return (String) param.put("1", "er");

	}

	private static Map<String, String> param = new HashMap<String, String>();

	public static void main(String[] args) {
		test(param);
		param.put("1", "yi");
		System.out.println(param);
	}
}

  

相关文章:

  • 2022-12-23
  • 2021-07-30
  • 2021-09-11
  • 2021-10-10
  • 2021-12-23
  • 2021-07-12
  • 2021-12-24
  • 2021-11-17
猜你喜欢
  • 2021-05-25
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案