OnJava8-Examples/operators/Equivalence.java
2016-09-23 13:23:35 -06:00

18 lines
430 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://OnJava8.com 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
*/