Skip to content

Instantly share code, notes, and snippets.

@agustarc
Created December 21, 2016 17:14
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 agustarc/cc89e6f0174129ae4a30fe1af7222b25 to your computer and use it in GitHub Desktop.
Save agustarc/cc89e6f0174129ae4a30fe1af7222b25 to your computer and use it in GitHub Desktop.
public class StringMemory {
public static void main(String... args) {
String literal = "loper";
String object = new String("loper");
System.out.println(literal == object);
System.out.println(literal.equals(object));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment