If A.equals(B) is true then A.getHashcode & B.getHashCode must always return same hash code in c#?

If A.equals(B) is true then A.getHashcode & B.getHashCode must always return same hash code in c#?

Flase because it is given that A.equals(B) returns true i.e. objects are equal and now its hashCode is asked which is always independent of the fact that whether objects are equal or not. So, GetHashCode for both of the objects returns different value. 

By:kamal
Date:2019-10-10 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Links

C interview questions and answers for experienced and fresher