Skip to content

Instantly share code, notes, and snippets.

@jukbot
Created November 28, 2015 07:50
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 jukbot/28f17be9850b815044aa to your computer and use it in GitHub Desktop.
Save jukbot/28f17be9850b815044aa to your computer and use it in GitHub Desktop.
public class JukIsNull {
private String name;
public void setName (String name) {
if(name == null ) {
String name2 = "JukHappy";
}
this.name = (name == null) ? name : name2; // <<-- check that is null?
}
}
// String = ""; <<-- Empty string
// String s2; <<-- null too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment