Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

throwing exceptions


  • Please log in to reply
1 reply to this topic

#1 BobLewiston

BobLewiston

  • Members
  • 69 posts
  • OFFLINE
  •  
  • Local time:07:19 AM

Posted 03 February 2009 - 12:21 PM

The documentation I've found is a little hazy on this subject, so it's time to fire off yet another no-doubt ignorant question:

Is "throw" intended exclusively for the following scenario: Control is transferred out of a try block via a method call, and code in the called method then detects an exception, so the called method uses "throw" to transfer control back to the appropriate catch block associated with the original try block?

BC AdBot (Login to Remove)

 


#2 Stu G

Stu G

  • Members
  • 85 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Glasgow Scotland
  • Local time:06:19 AM

Posted 26 February 2009 - 03:49 PM

A programming langaue will "throw an exception" when some code causes a system/API error ie change in normal program execution flow, which can be for many reason, syntax, logic are main reason, the compiler will throw a error, you can "catch" an exception by identifiy areas in a program that may cause a compile/runtime error and using the PL syntax to deal with this error in an elegant manor.

This is really basic but Exceptions differ between PLs, I guess you are using Java?
Stu G
Ada95,Java,C ANSI,C++,C♯,ASP.NET,JavaFX!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users