wood burning stoves 2.0*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 387
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: 18108
    
  39


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: 387
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static methods could be synchronized or not , how static method synchronization working ?
 
Similar Threads
Thread class
synchronized method
synchronized methods and blocks worries
q on package
Synchronization