I'm looking for a way to rename a Hashmap key, but i don't know if it's possible in Java.
Try to remove the element and put it again with the new name. Assuming the keys in your map are String, it could be achieved that way:
String
Object obj = map.remove("oldKey"); map.put("newKey", obj);
2.1m questions
2.1m answers
60 comments
57.0k users