- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariable.java
More file actions
Latest commit
24 lines (21 loc) · 575 Bytes
/
Copy pathVariable.java
File metadata and controls
24 lines (21 loc) · 575 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
importjava.util.Objects;
classVariable {
Stringname;
Stringtype;
Variable(Stringname, Stringtype){
this.name=name;
this.type=type;
}
@Override
publicbooleanequals(Objecto) {
if (this == o) returntrue;
if (o == null || getClass() != o.getClass()) returnfalse;
Variablevariable = (Variable) o;
returnObjects.equals(name, variable.name) &&
Objects.equals(type, variable.type);
}
@Override
publicinthashCode() {
returnObjects.hash(name, type);
}
}