Answer:
See explaination
Step-by-step explanation:
public class Circle {
private double radius;
private Location location;
private String name;
/* (non-Javadoc)
* atsee java.lang.Object#hashCode()
*/
atOverride
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((location == null) ? 0 : location.hashCode());
long temp;
temp = Double.doubleToLongBits(radius);
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
/* (non-Javadoc)
* atsee java.lang.Object#equals(java.lang.Object)
*/
atOverride
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Circle other = (Circle) obj;
if (location == null) {
if (other.location != null)
return false;
} else if (!location.equals(other.location))
return false;
if (Double.doubleToLongBits(radius) != Double.doubleToLongBits(other.radius))
return false;
return true;
}
NOTE: Replace all the "at" within the program with the at symbol ie shift 2.