In the code below I want to use the "term" attribute to generate the hash code. How to use this String attribute to generate hash code?
class Term {
String term;
@Override
public boolean equals(Object o) {
if (o instanceof Term) {
return this.term.equals(((Term)o).term);
}
return false;
}
@Override
public int hashCode() {
}
}