Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Throwing Errors

Throwing Errors

  • In Java terms, errors are thrown to an event handler which catches it and processes it.

  • Thus, exception objects are always instances of the Throwable class and can be thrown from a routine to an error handler. In the following example, we see that the readLine() method might throw an IOException error object if it has trouble reading a line.

    public String readLine() throws IOException

  • It is also of interest to know that a method may throw multiple errors by listing them as a comma separated list after the "throws" keyword.

  • Of course, a method may perform correctly without throwing an error. The throws portion just allows the method to deal with the "other" cases.

  • You can also throw your own error objects including both those available through the JDK as well as ones you create yourself.

Additional Resources:

Error Handling
Table of Contents
Catching Errors


Up to => Home / Authoring / Scripting / Tutorial




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers