This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

static synchronized block  RSS feed

 
Santosh Shiroor
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Difference between static synchronized block and synchronized block.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Santosh Shiroor:
Difference between static synchronized block and synchronized block.


I assume you are asking difference between a static synchronized method and synchronized method.
The difference is the object that is used as a monitor.
A static synchronized method uses the static member variable "class" as the monitor and synchronized method uses "this" as the monitor.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!