I Will Get That Job At Google. | Java Integer equality
To understand why it occurs you need to know how Java compares such values. In this case the method Integer.valueOf(i) is being called. This method caches values from -128 to 127 (as you may see in sources), so all Integer instances with value from this diapason will be equal in case of using == operation.
Read full article from I Will Get That Job At Google. | Java Integer equality
No comments:
Post a Comment