File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

join()

 
cybel sheriden
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
join() method should always be placed in a try catch clause as it might throw intruppted Exception.

is tht correct as it was not mentioned in K&b.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, strictly, it doesn't have to be in a try block; it could be in a method that declared that it throws InterruptedException (or a superclass.) But the compiler will insist on your doing one of these two things.
 
cybel sheriden
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so in the exam if a join()method is not enclosed in try catch clause ,i should choose that it would give complier error.
 
Georgy Bolyuba
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by cybel sheriden:
so in the exam if a join()method is not enclosed in try catch clause ,i should choose that it would give complier error.


If method that contains join() is declared with 'throws InterruptedException' you may not use try{}catch(){}; So if it's true there is no any error.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you type clear more English try as post not clear is very.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic