学习借鉴(其实搬了别人的好多)和自己的理解,可能会有较多错误,如有疑问联系我呀。
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Integer x = new Integer(10);
Integer y = 10;
Integer z = new Integer(10);
int temp = 10;
System.out.println(x == y); //false
System.out.println(x == z); // false
System.out.println(temp == x); // false
System.out.println(temp == y); // false
}
}