This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

which Collection Class is synchronied?  RSS feed

 
guo mark
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ara all Collection Class unsynchronied? or there are some synchronied and some unsynchronied?
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some are and some aren't. For example, ArrayList isn't synchronized while Vector is. Your best resource would be to check the API for whichever classes you're interested in.
Corey
 
guo mark
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3x
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, specifically Vector and HashTable are synchronized. All the other collection classes are unsynchronized. However, you can obtain a synchronized wrapper for the collection classes via the Collections class; but the default implementations are all unsynchronized (except for Vector and HashTable)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!