Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void test() {
- Map<Long,String> map = new HashMap<Long,String>();
- map.put(1L, "a");
- map.put(2L, "b");
- changeMethod(map);
- System.out.println(map.get(2L));
- }
- private void changeMethod(Map<Long, String> map) {
- Map<Long,String> otherMap = new HashMap<Long,String>();
- otherMap.put(1L,"c");
- otherMap.put(2L,"d");
- map = otherMap;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement