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

unable to get thread name  RSS feed

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote the program below .




it should print the name of the thread and after that "number rocks" but it does not why so?

instead while compiling i get a error in command line

 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tushar panda wrote:it should print "number rocks" and after that the name of the thread but it does not why so?

If you look at the code closely, you'll see it is actually written to do those two things in the opposite order from what you say.
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
tushar panda wrote:it should print "number rocks" and after that the name of the thread but it does not why so?

If you look at the code closely, you'll see it is actually written to do those two things in the opposite order from what you say.



oops i have half written the question , i have modified it .
 
Adam Michalik
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's Thread.currentThread(), not Thread.currentThread
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!