I have a hierarchy like this:
public class A {
public abstract int hashCode();
}
public class B extends A {
public int hashCode(){
//I want this to return the object implementation of hash code
return 0;
}
}
I want b.hashCode() to return the Object implementation of hashCode(). Unfortunately B has to extend A, and A can't change.
Just return System.identityHashCode(this).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With