java: comparing classes with == or .equals(): is there a difference? [duplicate]

大憨熊 提交于 2019-12-01 03:46:37

All objects have both identity (the object's location in memory) and state (the object's data). The == operator always compares identity. The default implementation of equals compares identity as well.

For a fuller explanation: http://www.javapractices.com/topic/TopicAction.do?Id=17

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!