• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static methods could be synchronized or not , how static method synchronization working ?

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

is static methods could be synchronized or not ? if yes then how can we achieve it and it no then why?

Please let me know the concept .
 
Henry Wong
author
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Synchronized static methods use the instance of the Class class, that represents the class, as the lock. This instance can be accessed via the ".class" property of the class.

Henry
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks and more thing could you frame this part with a small example over here.
 
T. Huy Nguyen
Ranch Hand
Posts: 57
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic