Java等于对象的方法 [英] Java equals method for object
本文介绍了Java等于对象的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在哪里可以找到为Object定义的equals()方法的源代码?我需要知道什么时候非覆盖的equals()方法会为类返回true!例如:假设Abc类中的equals方法未被覆盖,何时返回true?
abc a = new Abc();
abc b = new Abc();
System.out.println(a.equals(b));
我的尝试:
Java Object equals()方法源代码
解决方案
参见 Java™教程 [ ^ ]
Where can I find the source code for equals() method defined for Object? I need to know when will non overrided equals() method return true for a class! For example : Suppose equals method in Abc class is not overrided, When will this return true?
Abc a = new Abc();
Abc b = new Abc();
System.out.println(a.equals(b));
What I have tried:
Java Object equals() Method Source Code
解决方案
See The Java™ Tutorials[^]
这篇关于Java等于对象的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文