OnJava8-Examples/operators/Equivalence.java
2015-12-15 11:47:04 -08:00

18 lines
448 B
Java

// operators/Equivalence.java
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
public class Equivalence {
public static void main(String[] args) {
Integer n1 = new Integer(47);
Integer n2 = new Integer(47);
System.out.println(n1 == n2);
System.out.println(n1 != n2);
}
}
/* Output:
false
true
*/