Created
June 6, 2014 15:45
-
-
Save ddelponte/485bb1f43e5b4e1d3b3e to your computer and use it in GitHub Desktop.
When to use Collections.emptyList()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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