Skip to content

Commit 27c375c

Browse files
authored
Update Java基础知识.md
1 parent 461938d commit 27c375c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/java/Java基础知识.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ new运算符,new创建对象实例(对象实例在堆内存中),对象
301301

302302
**equals()** : 它的作用也是判断两个对象是否相等。但它一般有两种使用情况:
303303
- 情况1:类没有覆盖 equals() 方法。则通过 equals() 比较该类的两个对象时,等价于通过“==”比较这两个对象。
304-
- 情况2:类覆盖了 equals() 方法。一般,我们都覆盖 equals() 方法来两个对象的内容相等;若它们的内容相等,则返回 true (即,认为这两个对象相等)。
304+
- 情况2:类覆盖了 equals() 方法。一般,我们都覆盖 equals() 方法来比较两个对象的内容是否相等;若它们的内容相等,则返回 true (即,认为这两个对象相等)。
305305

306306

307307
**举个例子:**

0 commit comments

Comments
 (0)