• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

attention Bert

 
Sriram Chintapalli
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bert,
when we try to restart a thread(call start on a thread that has already started) the compiler just ignores it! but is it true that for the sake of the exam we have to answer it as a runtime error???(confused). Can you please throw some light on similar situations where the compiler and exam answers conflict!
I like a lot of others to give their opinions on this, but I want Berts' word too.
thanks in advance,
sriram
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Sriram, you're right. For the sake of the exam, as far as I remember, we are supposed to answer it as error only.
Hope this helps, thanks.
 
Richard Quist
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
API doc for the Thread class says an IllegalStateException is thrown if start() is called on a Thread that's already started.
 
Yuriy Grechukhin
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible that you are catching (and ignoring)IllegalStateException or one of it's supper classes?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic