Public
Authored by Anya Helene Bagge 🦆

Objects.java

Edited
2.56 KB
  • 
    Double objects:
     0.0  !=  0.0  (Double a@1554874502 b@1846274136)
     1.0  !=  1.0  (Double a@1639705018 b@1627674070)
    Infinity  !=  Infinity (Double a@1360875712 b@1625635731)
     NaN  !=  NaN  (Double a@1580066828 b@491044090)
    
    Integer objects:
       0  ==  0    (Integer a@644117698 b@644117698)
     127  ==  127  (Integer a@1872034366 b@1872034366)
     127  ==  127  (Integer a@1872034366 b@1872034366)
     127  ==  127  (Integer a@1872034366 b@1872034366)
     128  !=  128  (Integer a@1581781576 b@1725154839)
       1  !=  1    (Integer a@1670675563 b@723074861)
       2  ==  2    (Integer a@895328852 b@895328852)
    
    String objects:
       a  ==  a    (String a@1304836502 b@1304836502)
       a  !=  a    (String a@225534817 b@1304836502)
       a  !=  a    (String a@1878246837 b@929338653)
       a  ==  a    (String a@1304836502 b@1304836502)
       a  ==  a    (String a@1304836502 b@1304836502)
    java.lang.Object@4b1210ee  !=  java.lang.Object@4d7e1886 (Object a@1259475182 b@1300109446)
    
    String concatenation (+):
      ab  ==  ab   (String a@1020371697 b@1020371697)
      ab  !=  ab   (String a@1020371697 b@789451787)
      ab  ==  ab   (String a@1020371697 b@1020371697)
      ab  !=  ab   (String a@1020371697 b@1950409828)
    
    also – double and float are not exact:
    1.00 == 1.00 ? false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment