Forums Register Login

Boolean comparison

+Pie Number of slices to send: Send
Why would
if( new Boolean("true") == new Boolean("true"))
be false?
+Pie Number of slices to send: Send
Hi Geeta. The == operator checks to see if two objects are one of the same at the heap. The "new" operator was used for each operand thus creating two distinct objects. Using ".equals(..)" will result to true.
+Pie Number of slices to send: Send
Oh! how could i miss that!!! I guess, i've studied alot and its time for me to sleep. Tomorrow is the BIG day :-)
+Pie Number of slices to send: Send
Your exam is tomorrow? Good luck Geeta!
+Pie Number of slices to send: Send
Thanks Allison
I once met a man from Nantucket. He had a tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 578 times.
Similar Threads
why(boolean b3=true;)(Boolean b4=true;)is both right?
Boxing - Boolean question
errata or ??
regarding Wrapper's unboxing
a doubt....
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:38:44.