Primitives (like int) use value comparison when using ==. Objects (like Integer) use reference comparison when using ==.Java maintains an internal cache of frequently used Integer objects in the range -128 to 127 to optimize memory usage.When numbers are within the cache range, Java reuses existing objects; otherwise, new objects are created.It is recommended to use .equals() for value comparison when working with wrapper classes.