Method toString() returns a String representation of an object. Every time it is called on an object of class Integer, a new String object is created. Operator == compares two references to two String objects, and not the real values of those String objects.
Login in to like
Login in to comment