0
   

Why should I place a loop inside the try-catch block when using Thread.sleep(..) ?

 
 
Reply Mon 27 Dec, 2010 09:12 am
Liang mentioned in his book, Introduction to Java Programming(2009), that when we use Thread.sleep(..) in side the loop, the entire loop has to be wrapped with try-catch block rather than just loop only. Please anyone can explain this ? I have no idea what the heck it does mean.

Please go see his book from:
http://books.google.com/books?id=juuPxtSCg50C&pg=PA935&lpg=PA935&dq=%22If+the+loop+is+outside+the+try-catch+block+%22&source=bl&ots=TxU4lm8Wx1&sig=rzr8ziwK0qejzbtFhi0RRK31JyY&hl=en&ei=6dAXTeyjBcSAlAfO9fDHBQ&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBMQ6AEwAA
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 0 • Views: 1,144 • Replies: 0
No top replies

 
 

Related Topics

Disable Java? - Discussion by engineer
java jws - Question by rockerpham
java to mips - Question by themanwhoknowsandask
Ubuntu, Java and Aptana Studio 3 - Question by Ken Dawson
Java Question,time converter. - Question by Loh Jane
unescape javascripts - Question by happy5
Java Programming Question? - Question by evang14
 
  1. Forums
  2. » Why should I place a loop inside the try-catch block when using Thread.sleep(..) ?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 04/26/2024 at 06:42:12