17. A == B? A.Equals(B)?
For struct,
A == B,
depend on the implementations of
operators “==” and “!=”.
A.Equals(B),
T
rue, If all fields of A and B are equal.
18. A == B? A.Equals(B)?
Stack
pt_1
pt_2
Equals() is T
rue, if all fields are
the same in struct.
x = 3
y=5
x=3
y=5
19. A == B? A.Equals(B)?
For class,
A == B
T
rue, if they point to the same heap memory address.
A.Equals(B)
Depends on the implementations of Equals().
Equals() of System.Object class
Compare memory addresses.