Given the class Species as defined in Listing 5.19, why does the following
program cause an error message?
public class SpeciesEqualsDemo
{
public static void main(String[] args)
Species s1, s2; s1.
setSpecies("Klingon ox", 10, 15);
s2.setSpecies("Klingon ox", 10, 15);
if (s1 == s2)
System.out.println("Match with ==.");
else
System.out.println("Do Not match with ==.")
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here