Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cd32cda

Browse files
Fix typo (#578)
1 parent 897c0af commit cd32cda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎docs/book/Appendix-Understanding-equals-and-hashCode.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ import java.util.*;
6969
public class Equality {
7070
protected int i;
7171
protected String s;
72-
protected double d;public Equality(int i, String s, double d) {
72+
protected double d;
73+
public Equality(int i, String s, double d) {
7374
this.i = i;
7475
this.s = s;
7576
this.d = d;
@@ -141,7 +142,7 @@ Expected false, got false
141142

142143
**testAll()** 执行了我们期望的所有不同类型对象的比较。它使用工厂创建了**Equality**对象。
143144

144-
**main()** 里,请注意对 **testAll()** 的调用很简单。因为**EqualityFactory**有着单一的函数,它能够和lambda表达式一起使用来表示**make()**函数。
145+
**main()** 里,请注意对 **testAll()** 的调用很简单。因为**EqualityFactory**有着单一的函数,它能够和lambda表达式一起使用来表示**make()**函数。
145146

146147
上述的 **equals()** 函数非常繁琐,并且我们能够将其简化成规范的形式,请注意:
147148
1. **instanceof**检查减少了**null**检查的需要。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /