| 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
|
|
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
|
 |
 |
|
|
subject: static methods could be synchronized or not , how static method synchronization working ?
|
|
|