Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

ThreadLocal class

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please help me with this question of ThreadLocal class
Q: The java.lang.ThreadLocal class uses what collection to associate an object with the current thread.
1)WeakHashMap
2)Set
3)Thread[]
4)List
5)Collection
I think it is either 1 or 2. Can someone clarify or is it something else.
Thanks
Nilesh Patel
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WeakHashMap
http://www.jguru.com/jguru/faq/view.jsp?EID=113620
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

nice find Cindy. Yes'day I read thru all the ThreadLocal class
API and couldn't find anything. I also went thru its Child class.
Not sure how to find such ans.
regds.
- satya
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case I went to www.go.com and did a search on
ThreadLocal -API
and got hundreds of hits. Peeked at about 10 skipping the ones that were irrevelant (do you KNOW how many languages have a ThreadLocal - amazing) till I found this reference.
 
NILESH PATEL
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cindy,
Well spoted. It explaines in great detail.
Thnaks again for your help.
See you again
Nilesh
 
Where does a nanny get ground to air missles? Protect this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic