Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronizing Static Methods

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are these 3 methods synchronized on the same lock? That is, are static methods synchronized on the class object for the class?

In thread 1

In thread 2

 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, they are.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic