Page 1 of 1

About Question enthuware.ocpjp.v7.2.1331 :

Posted: Sat Mar 29, 2014 3:04 pm
by jaypi
I don't understand the question...

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Sat Mar 29, 2014 7:27 pm
by admin
It is asking what happens when you call the put method.

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Mon Jan 09, 2017 8:02 am
by jagoneye
It would be a lot helpful if someone would post which classes allow null key/values insertion and which not.

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Mon Apr 17, 2017 10:23 am
by maarten03
FYI: The function returns the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

I was doubting.

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Thu May 18, 2017 1:27 pm
by lenalena
No Nulls: ArrayDeque, Hashtable, TreeSet, ConcurrentHashMap, ConcurrentSkipListMap (and most other concurrent collections)
No Null Keys: TreeMap

Everything else is OK with null, as much as I was able to gather...

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Fri Dec 22, 2023 7:52 am
by Badem48
I am confused about the put() method signature.
The signature of put() method in HashMap is V put(K key, V Value);
Where is that signature with objects coming from?

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Sat Dec 23, 2023 3:30 am
by admin
V and K are type parameters. They are relevant only while compilation. After compilation, they are replaced by Object (or their bounds).

Re: About Question enthuware.ocpjp.v7.2.1331 :

Posted: Sat Dec 23, 2023 7:01 am
by Badem48
Yes that is correct.