jQuery in Action, 2nd edition*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in Vector  Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in Vector  Class" Watch "Doubt in Vector  Class" New topic
Author

Doubt in Vector Class

Geetha Arthanari
Greenhorn

Joined: Nov 24, 2006
Posts: 25
Actually we cna't declare class as a Synchronized class.
But we're telling vector class is a Synchronized onel
What's the meaning for that?Anyone can explain me Pls?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

It means that it's methods are thread safe. Only one thread can access it's method at any given time.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Geetha Arthanari
Greenhorn

Joined: Nov 24, 2006
Posts: 25
Thank you for your Details.now i'm clear.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
There certainly exists something called class level synchronization.Object level syncronization and class level synchronization is differentiated by the lock that you aquire.
Vector is synchronized as because the methods are synchronized and would prevent data corruption while accessed by multiple threads.


Rahul Bhattacharjee
LinkedIn - Blog
Geetha Arthanari
Greenhorn

Joined: Nov 24, 2006
Posts: 25
Thank you Rahul.
 
jQuery in Action, 2nd edition
 
subject: Doubt in Vector Class