没有被明显的调用或引用然而注释以后与注释前的结果却不同,请给予指点!
import java.util.*;public class BasicContainer{ public static void main(String args[]) {Collection c=new HashSet();c.add("hello");c.add(new Name("fi","li"));c.add(new Integer(100));System.out.println(c);c.remove("hello");c.remove(new Integer(100));System.out.println(c.remove(new Name("fi","li")));System.out.println(c);}}class Name{ private String firstName,lastName; public Name(String firstName,String lastName) { this.firstName=firstName; this.lastName=lastName; } public String getFirstName() {return firstName;} public String getLastName() {return lastName;} public String toString() {return firstName+" "+lastName;} /*public boolean equals(Object obj) { if(obj instanceof Name) { Name name=(Name) obj; return (firstName.equals(name.firstName))&&(lastName.equals(name.lastName)); } return super.equals(obj); } public int hashCode() { return firstName.hashCode(); }*/ }