import java.util.HashMap; import java.util.Map; public class MainClass { public static void main(String[] argv) { Map map = new HashMap(); map.put("key", "value"); // the older value is removed and returned map.put("key", "value new"); System.out.println(map); } }
{key=value new}