# c＃是否與Java with equals和gethashcode（）有相同的問題？

c＃是否具有與equals和gethashcode相同的問題？

## 最佳答案

However, .NET has the IEqualityComparer interface which is frequently used for equality and hashing - for containers such as Dictionary. Almost everything in the framework which needs equality/hashing allows the behaviour to be specified by an IEqualityComparer, which means you can express whichever notion of equality you want, if the form given by the type itself is inappropriate for your needs.