Skip to content

Instantly share code, notes, and snippets.

@chermehdi
Created November 7, 2016 13:22
Show Gist options
  • Save chermehdi/6b18b15e69ea2fab3ee13704d069c57c to your computer and use it in GitHub Desktop.
Save chermehdi/6b18b15e69ea2fab3ee13704d069c57c to your computer and use it in GitHub Desktop.
String a = "MyString";
String b = "MyOtherString";
a = a + b; // a new String has been created here
String s = a.substring(1); // the "a" string is not modified a new String Object is created every single time
// we do this kind of operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment