Lambda Expression: == vs. .Equals()

前端 未结 6 820
名媛妹妹
名媛妹妹 2021-01-07 23:09

This is a purely academic question, but what\'s the difference between using == and .Equals within a lambda expression and which one is preferred?

Code exam

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 23:24

    This is more prominent in the Java world really. Basically '==' is operator overloading and .Equals() is the base method on Object class.

提交回复
热议问题