This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes static methods could be synchronized or not , how static method synchronization working ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static methods could be synchronized or not , how static method synchronization working ? " Watch "static methods could be synchronized or not , how static method synchronization working ? " New topic
Author

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

Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 391
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
Sheriff

Joined: Sep 28, 2004
Posts: 18538
    
  40


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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 391
thanks and more thing could you frame this part with a small example over here.
T. Huy Nguyen
Ranch Hand

Joined: Nov 02, 2010
Posts: 57




My material for SCJP (2008), SCWCD (2010), SCBCD (2010). About me
 
 
subject: static methods could be synchronized or not , how static method synchronization working ?
 
Similar Threads
Thread class
Synchronization
q on package
synchronized method
synchronized methods and blocks worries