• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads

 
Bharadwaj Adepu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider this code..




the out put is
End
run


Am not able to understand the flow
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What dont you understand there ? Why you got Exception is that your throwing it.

Heres my code

[ July 20, 2008: Message edited by: mandlar suurla ]
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think he wants to know why End is printing first. If I am correct, I would suggest you to read join

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mandlar suurla:

Heres my code


Don't know what this adds to the discussion. You would never call "run()" on a Thread, as it's only by calling "start()" that you invoke the special behavior of a thread. And of course the "Runnable" route is preferable to subclassing Thread. satishkumar's advice is good.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic