forked from PacktPublishing/Java-Coding-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.java
More file actions
40 lines (34 loc) · 735 Bytes
/
A.java
File metadata and controls
40 lines (34 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package modern.challenge;
public class A {
private final int a;
public A(int a) {
this.a = a;
}
@Override
public int hashCode() {
int hash = 7;
hash = 97 * hash + this.a;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final A other = (A) obj;
if (this.a != other.a) {
return false;
}
return true;
}
@Override
public String toString() {
return "A{" + "a=" + a + '}';
}
}