多选题 Given:
2. class Chilis {
3. Chilis (String c, int h) {color = c; hotness = h; }
4. String color;
5. int hotness;
6. public boolean equals(Object o) {
7. if(this == (Chilis)o) return true;
8. return false;
9. }
10. public String toString() {return color + " " + hotness; }
11. }
If instances of class Chilis are to be used as keys in a Map, which are true? (Choose all that apply.)
【正确答案】 B、C、E
【答案解析】