Package advancejava; public class box {public static void main (string ARGs []) {integer a = 127; integer B = 127; system. out. println (A = B); integer c = 128; integer d = 128; system. out. println (C = D);/** if the size of the integer closed object * is within one byte, -128-127 * puts the encapsulated object in the constant pool, * If the encapsulated object is larger than one byte * Put It In The heap * This is the above * A = B * C! = D; ** this is a metadata-Sharing Mode */}}Package advancejava; import static Java. lang. system. *; public class box {public static void main (string ARGs []) {integer a = 1; integer B = 2; integer c = 3; integer d = 3; integer e = 321; integer F = 321; long G = 3l; out. println (C = D); out. println (E = f); out. println (C = (a + B); out. println (C. equals (A + B); out. println (G = (a + B); out. println (G. equals (A + B); out. println ("--------");/** if If the size of an integer closed object * is within one byte, that is,-128-127 *, the encapsulated object is placed in the constant pool, * If the encapsulated object is larger than one byte * Put It In The heap * This is the above * A = B * C! = D; ** this is a metadata-Sharing Mode */}}
Package advancejava; import static Java. lang. system. *; public class box {public static void main (string ARGs []) {integer a = 1; integer B = 2; integer c = 3; integer d = 3; integer e = 321; integer F = 321; long G = 3l; out. println (C = D); out. println (E = f); out. println (C = (a + B); out. println (C. equals (A + B); out. println (G = (a + B); out. println (G. equals (A + B); out. println ("--------");/** if If the size of an integer closed object * is within one byte, that is,-128-127 *, the encapsulated object is placed in the constant pool, * If the encapsulated object is larger than one byte * Put It In The heap * This is the above * A = B * C! = D; ** this is a metadata mode */}/* decompiled Code * integer a = integer. valueof (1); integer B = integer. valueof (2 );
Integer c = integer. valueof (3); integer d = integer. valueof (3); integer e = integer. valueof (321); integer F = integer. valueof (321); long G = long. valueof (3l); system. out. println (C = D); system. out. println (E = f); system. out. println (C. intvalue () =. intvalue () + B. intvalue (); system. out. println (C. equals (integer. valueof (. intvalue () + B. intvalue (); system. out. println (G. longvalue () =. intvalue () + B. intvalue (); system. out. println (G. equals (integer. valueof (. intvalue () + B. intvalue ())));**/