This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

join()

 
cybel sheriden
Ranch Hand
Posts: 50
  • 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: 24212
35
Chrome Eclipse IDE Mac OS X
  • 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
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you type clear more English try as post not clear is very.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic