...That Strings are objects in java. It seems so odd. Just spent 10 minutes trying to debug why
(inType == "value") was returning false.
Derp.
I am not a smart Java.
...That Strings are objects in java. It seems so odd. Just spent 10 minutes trying to debug why
(inType == "value") was returning false.
Derp.
I am not a smart Java.
use .equals for value comparison, unless it's a primitive.
== is object equality.
There is also a difference between int and Integer, one is primitive and another is objects. While auto(un)boxing makes it so you can use both, == will still fail with that.
use .equals for value comparison, unless it's a primitive.
== is object equality.
There is also a difference between int and Integer, one is primitive and another is objects. While auto(un)boxing makes it so you can use both, == will still fail with that.
Yeah, i learnt this on my own with some testing.
0 members, 0 guests, 0 anonymous users