Maybe this helps:
map.put(newkey,map.remove(oldkey));
More Related Contents:
- Iterate through a HashMap [duplicate]
- is the Java HashMap keySet() iteration order consistent?
- Remove Elements from a HashSet while Iterating [duplicate]
- What are the differences between a HashMap and a Hashtable in Java?
- Iterating through a Collection, avoiding ConcurrentModificationException when removing objects in a loop
- How to loop through a HashMap in JSP?
- How can I convert JSON to a HashMap using Gson?
- Cartesian product of an arbitrary number of sets
- Obtaining a powerset of a set in Java
- What is the easiest/best/most correct way to iterate through the characters of a string in Java?
- Java Set retain order?
- Is a HashMap thread-safe for different keys?
- Getting an element from a Set
- What is the significance of load factor in HashMap?
- Why there is no ConcurrentHashSet against ConcurrentHashMap
- Can an array be used as a HashMap key?
- Sorting hashmap based on keys
- What is the fastest way to compare two sets in Java?
- How to iterate through range of Dates in Java?
- What is the optimal capacity and load factor for a fixed-size HashMap?
- HashMap implementation in Java. How does the bucket index calculation work?
- HashMap to return default value for non-found keys?
- How can I iterate over a map of ?
- Memory overhead of Java HashMap compared to ArrayList
- Is it possible to merge iterators in Java?
- How does ConcurrentHashMap work internally?
- Convert Set to HashMap
- Why are immutable objects in hashmaps so effective?
- How to convert a string to a HashMap? [duplicate]
- Explain the timing causing HashMap.put() to execute an infinite loop