Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Integer class is only guaranteed to cache integer values from -128 to 127 to 128, which can result in equivalent values outside this range comparing as unequal when tested using the equality operators. For example, a JVM that did not cache any other values when running this program would output

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="60f1be5312479c63-60af89ea-45b94b2d-897b99c4-dd0d97eaf339bc577a50cff6"><ac:plain-text-body><![CDATA[

[[Bloch 2009

AA. Bibliography#Bloch 09]]

4. "Searching for the One"

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5ebd84ce740ffe1b-63750039-440340d0-936cb824-809b1d508d018b39321bf07a"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. Bibliography#JLS 05]]

[§5.1.7, "Boxing Conversion"

http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="803ab2abf0809b29-cad96d4f-42034792-8485b86c-ac5c9c559da4d5c6f4fbba31"><ac:plain-text-body><![CDATA[

[[Pugh 2009

AA. Bibliography#Pugh 09]]

Using == to compare objects rather than .equals

]]></ac:plain-text-body></ac:structured-macro>

...