Created
September 7, 2017 10:38
-
-
Save njlr/167829b767336836085c3f0ea53b9d34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
final List<String> xs = new ArrayList<>(); | |
// We can modify xs internally | |
xs.add("a"); | |
xs.add("b"); | |
xs.add("c"); | |
// ... but we cannot change where it points to! | |
xs = new ArrayList<>(); // Will not compile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment