• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

synchronized

 
josephine chen
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i use synchronized keyword with ordinary methods
that do not involve threads.If so i want a small example
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can. And synchronized methods can be used in a NON-threaded environment. It would be a waste but still...
An example? Put the word "synchronized" in front of any method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic