Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static synchronized block

 
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