Skip to main content
added 29 characters in body
Source Link
JB Nizet
  • 694.2k
  • 94
  • 1.3k
  • 1.3k
  1. The map stores a a copy of the reference to the object passed as argument. No copy of objects is made.
  2. Yes, you will get "A Value" back, as documented. A Map compares its keys with equals(), not == (except for IdentityHashMap). You could test that pretty easily, BTW.
  1. The map stores a a copy of the reference to the object passed as argument. No copy of objects is made.
  2. Yes, as documented. A Map compares its keys with equals(), not == (except for IdentityHashMap). You could test that pretty easily, BTW.
  1. The map stores a a copy of the reference to the object passed as argument. No copy of objects is made.
  2. Yes, you will get "A Value" back, as documented. A Map compares its keys with equals(), not == (except for IdentityHashMap). You could test that pretty easily, BTW.
Source Link
JB Nizet
  • 694.2k
  • 94
  • 1.3k
  • 1.3k

  1. The map stores a a copy of the reference to the object passed as argument. No copy of objects is made.
  2. Yes, as documented. A Map compares its keys with equals(), not == (except for IdentityHashMap). You could test that pretty easily, BTW.