多选题
Given:
2. import java.util.*;
3. public class Birthdays {
4. public static void main(String[] args) {
5. Map<Friends, String> hm=new HashMap<Friends, String>();
6. hm.put(new Friends("Charis"), "Summer 2009");
7. hm.put(new Friends("Draumur"), "Spring 2002");
8. Friends f=new Friends(args[0]);
9. System. out.println (hm.get(f));
10. }
11. }
12. class Friends {
13. String name;
14. Friends(String n) {name=n; }
15. }
And the command line invocation:
java Birthdays Draumur
What is the result?
A. null
B. Draumur
C. Spring 2002
D. Compilation fails.
E. The output is unpredictable.
F. An exception is thrown at runtime.
G Friends@XXXX (where XXXX is a representation of a hashcode)