Consider the following method written for the class Player: public boolean equals(Object o) { Player p =
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the following method written for the class Player:
public boolean equals(Object o)
{
Player p = (Player) o; //1
if (p.getGoals() == this.getGoals() &&
p.getName().equals(this.getName()))
{
return true;
}
return false;
}
Answer the following questions about this code:
(i)
What is the result of using the
public
access modifier in terms of
accessibility
and in terms of
inheritance
of the method
equals()
?
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date: