In Java,

(1) The equals() method of ordinary reference variables compares the addresses of objects,

(2) The equals() method of reference types such as Interger and Float compares the values of two objects rather than their addresses.

 

 

(3) If the forward reference variable points to null, it cannot be unpacked, and Java will not be able to detect it, so there will be a null pointer exception at runtime.

This is also called CompilerSuger.