This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

run() method  RSS feed

 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hvae one confusion ,
here is the code :



In the above class there I can write two different kind of run method :
1)1st form


2)2nd form



What is the difference between these two run methods ? which one is better to use ?


regards,
S
 
Vijitha Kumara
Bartender
Posts: 3992
27
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
s begri wrote:What is the difference between these two run methods ? which one is better to use ?

It may depends on the requirement. Using "this" synchronizes on the current instance, and with "Letter.class" synchronizes on the Class object represents the "Letter" class in the JVM.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!