File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "which Collection Class is synchronied?" Watch "which Collection Class is synchronied?" New topic

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.

SCJP Tipline, etc.
guo mark
Ranch Hand

Joined: Oct 20, 2001
Posts: 43
Rob Ross

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)

SCJP 1.4
I agree. Here's the link:
subject: which Collection Class is synchronied?
It's not a secret anymore!