Skip to content

Instantly share code, notes, and snippets.

@maggandalf
Created April 9, 2011 09:49
Show Gist options
  • Save maggandalf/911282 to your computer and use it in GitHub Desktop.
Save maggandalf/911282 to your computer and use it in GitHub Desktop.
Implementing Equals with Objects class.
public void showFoo(Foo foo) {
Foo foo2 = new Foo();
//lot of code
if(Objects.equals(foo,foo2)) {
System.out.println("Two Men");
} else {
System.out.println("And a Half");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment