Answer is TreeMap But according to my understanding answer should be g. None of the above as TreeMap doesn't satisfies the second condition "b. Allows null elements, keys, and values." Treemap allows null values but doesn't allow null key . Can anyone give more thought on this and explain to me is anywhere I am wrong in understanding the question or what? Thanks
Joined: Dec 22, 2002
Correct me if im wrong, but cant a TreeMap take 1 null key (and many null values)... I guess the question means only this, by 'accepting null'.
Thanks<br />Karthik<br />SCJP 1.4, CCNA.<br /> <br />"Success is relative. More the success, more the relatives."
Joined: Mar 17, 2003
As far my understanding of TreeMap it'll not accept any null key.
Joined: Apr 03, 2003
try the following code. It compiles and runs. So I guess TreeMapdoes accept a null key and null values.