In Java, integer i1= 0; Integer i2= 0; There is I1 = = I2, and there is I1 = 1; then why I2 not become 1?
My idea at this point is this: because the integer constants in Java are based on int, and there is an automatic wrapper mechanism in Java, which means that I1,i2 is an integer type, But the bottom level is still based on the int type (incomprehensible words in Java there is another place that is arrays.aslist (T...args) He returns an array-based list, and if you change its size in the list, an exception is thrown [ Unsupportedoperationexception]), so point to the same value (int), so you can use the = = symbol can be understood, and if you are assigned to I1 by the new Integer (0), then, because it is new in the heap to open up a piece of memory, So with the = = symbol between the same object is compared memory address, then it is certainly false, and do not say the same object, and because the I2 is based on the Int class, in the potential to compare the weight is to return a false, although the surface looks like they are the same type!!
In Java, integer i1= 0; Integer i2= 0; Why do you use the = = symbol?