What is the diff between equality of objects and equality of references that refer to them?
Answers
Answered by
3
Main difference between .equals() method and == operator is that one is method and other is operator. ... Both s1 and s2 refers to different objects.
HOPE HELPS ✌️
HOPE HELPS ✌️
Answered by
0
In this code, two objects are created, but after the assignment statement, both references refer to the same object. Therefore they have reference equality. Use the ReferenceEquals method to determine whether two references refer to the same object. The concept of reference equality applies only to reference types.
Similar questions