posted 16 years ago
which produces something like this:
Dog@1c
DOG
CAT key
Dog key
null
5
If we add two lines of code to the end of the earlier MapTest.main(),
d1.name = "magnolia"
System.out.println(m.get(d1));
we get something like this:
Dog@4
DOG
CAT key
Dog key
null
5
null
I am really confused why the output is "null" after setting d1.name="magnolia", I suppose the output should be "Dog key". I have compiled this code but still confused how it is working.