Skip to content

Instantly share code, notes, and snippets.

@d3ep4k
Created November 5, 2018 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d3ep4k/38c73c4f1e1f7f803f5d962126230930 to your computer and use it in GitHub Desktop.
Save d3ep4k/38c73c4f1e1f7f803f5d962126230930 to your computer and use it in GitHub Desktop.
Java is pass by value. You cannot change the reference
map = new HashMap();
map.put("name","intellect");
void modify(map){
map.get("name")
map.put("name","trade");
map = new HashMap();
map.put("name","scf");
}
modify(map)
println map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment