Simon Leung
asked on
JEE Code query
What does the following code mean ?What does "^" represent ?
@Override
public int hashCode() {
return (
(this.getPartNumber()==null?0:this.getPartNumber().hashCode())
^
((int) this.getRevision())
);
}
Beside, what doesthe highlighted code below mean ?
@Override
public boolean equals(Object otherOb) {
if (this == otherOb) {
return true;
}
if (!(otherOb instanceof PartKey)) {
return false;
}
PartKey other = (PartKey) otherOb;
return (
(this.getPartNumber()==null?other.getPartNumber()==null:this.getPartNumber().equals(other.getPartNumber()))
&&
(getRevision() == other.getRevision())
);
}
@Override
public int hashCode() {
return (
(this.getPartNumber()==null?0:this.getPartNumber().hashCode())
^
((int) this.getRevision())
);
}
Beside, what doesthe highlighted code below mean ?
@Override
public boolean equals(Object otherOb) {
if (this == otherOb) {
return true;
}
if (!(otherOb instanceof PartKey)) {
return false;
}
PartKey other = (PartKey) otherOb;
return (
(this.getPartNumber()==null?other.getPartNumber()==null:this.getPartNumber().equals(other.getPartNumber()))
&&
(getRevision() == other.getRevision())
);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.