Question: Plz do 2 problems 5. (5 points) A hashCode function is used to compute a 32-bit integer representing an Object. Is the following hashCode function
5. (5 points) A hashCode function is used to compute a 32-bit integer representing an Object. Is the following hashCode function poorly written? yes or no and why. COverride public int hashCodeO int temp = 17; //returns a random integer return temp (new Random)).nextIntO 6. (5 points) An equals function is used to compare two objects for equality. Is the following hashCode function poorly written? yes or no and why. 0Override public boolean equals(Object o) if (thiso) return true; return this.xo.x kk this . y o.y && this.angle o.angle k this.currentHealtho.currentHealth
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
