This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 361
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: 16690
    
  19


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: 361
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
q on package
synchronized method
synchronized methods and blocks worries
Thread class
Synchronization