Why is == true for some Integer objects? [duplicate]

In the first case, both the objects i and j are pointing to the same cached object. By default, the range between -128 and 127 are cached as Integer Object. We can increase the range using JVM arguments

Leave a Comment