+ 1
If a.x is 5 And b.x is 5 why is it not equal?
6 Réponses
+ 2
Because you have two different objects: a and b. They having the same value is irrelevant: they are still two different objects.
+ 1
it's different references
+ 1
Actually ahiad what happens if you are using == then it compares the reference object like a, b both are unequal so it is false
+ 1
Though the content in each object is same, they are stored in different memory locations and hence they are two different objects
0
Two different instances
0
Is this the first discuss thing ever posted on sololearn?