- Notifications
You must be signed in to change notification settings - Fork 366
/
Copy pathAbc.java
31 lines (25 loc) · 610 Bytes
/
Abc.java
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
publicclassAbc {
publicStringgetString() {
returnstring;
}
publicintgetValue() {
returnvalue;
}
privateStringstring;
privateintvalue;
publicAbc(Stringstring, intvalue) {
this.string = string;
this.value = value;
}
@Override
publicbooleanequals(Objectobject) {
if (object == this) {
returntrue;
}
if (!(objectinstanceofAbc)) {
returnfalse;
}
Abcabc = (Abc) object;
returnstring.equals(abc.getString()) && value == abc.getValue();
}
}