This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes which Collection Class is synchronied? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "which Collection Class is synchronied?" Watch "which Collection Class is synchronied?" New topic
Author

which Collection Class is synchronied?

guo mark
Ranch Hand

Joined: Oct 20, 2001
Posts: 43
Ara all Collection Class unsynchronied? or there are some synchronied and some unsynchronied?


meet once ,love every while
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
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


SCJP Tipline, etc.
guo mark
Ranch Hand

Joined: Oct 20, 2001
Posts: 43
3x
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
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)


Rob
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which Collection Class is synchronied?
 
Similar Threads
Errors in Mr.Marcus Green's Mock 2
synchronizedSortedMap(new HashSortedMap()) error
Collections
static synchronized method in a StatelessSessionBean
synchronized methods