Skip to content

Instantly share code, notes, and snippets.

@gbajaj
Created July 8, 2019 20:23
Show Gist options
  • Save gbajaj/9a9cb204e95d8d31b287d3491a444d39 to your computer and use it in GitHub Desktop.
Save gbajaj/9a9cb204e95d8d31b287d3491a444d39 to your computer and use it in GitHub Desktop.
Compare Integers with Objects
public class Main {
public static void main(String[] args) {
Integer a = new Integer(10);
Integer b= new Integer(10);
if (a == b) {
System.out.println("true");
} else {
System.out.println("false");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment