Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Vector Class

 
Geetha Arthanari
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10105
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that it's methods are thread safe. Only one thread can access it's method at any given time.
 
Geetha Arthanari
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your Details.now i'm clear.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Geetha Arthanari
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Rahul.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic