Skip to content

Instantly share code, notes, and snippets.

@ddelponte
Created June 6, 2014 15:45
Show Gist options
  • Save ddelponte/485bb1f43e5b4e1d3b3e to your computer and use it in GitHub Desktop.
Save ddelponte/485bb1f43e5b4e1d3b3e to your computer and use it in GitHub Desktop.
When to use Collections.emptyList()
Collections.emptyList()
// Use Collections.emptyList() when you do not wish to modify the returned list, otherwise []
// That's what you use if you want to pass a default parameter that will not be modified by the called funciton
// http://stackoverflow.com/questions/5552258/collections-emptylist-vs-new-instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment