The method:
public int hashCode() {
return (int) this.hashCode();
}
would lead to an StackOverflowError
because it recurse into itself infinitely, unless you replace this
with super
. Your second method has the same problem.
In addition, casting a value of type int
into an int
is useless as well.
If you do not provide anything useful new to a method, just don't override it.