Is it possible to use Thread (Thread.getCurrentThread()) as a KEY in a collection (e.g. HashMap) ?
I know that it's POSSIBLE! but I want to know that if java creates unique hashCodes for threads ,
Thanks , Arian
Yes, people did that before Java had ThreadLocal
.
But now you probably should use ThreadLocal
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With