The Artima Developer Community
Sponsored Link

Java Answers Forum
exception handling

2 replies on 1 page. Most recent reply: Dec 5, 2003 3:47 AM by Adam Duffy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
kamalapriya

Posts: 1
Nickname: kamala
Registered: Dec, 2003

exception handling Posted: Dec 4, 2003 7:33 AM
Reply to this message Reply
Advertisement
how do try and catch mechanism work?


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: exception handling Posted: Dec 4, 2003 8:36 AM
Reply to this message Reply
f(x) is a Method wich throws the Exception of F_Exception type.

try {
f(x);
} catch (F_Exception e)
{
e. ...
}

It's just that:
If f(x) produces the exception, the program will stop the execution of the code inside the try-catch block and go to the catch-block.
There also exists a "finally" option, but you won't need it most of the time.
You should read about that in a Java book.

Adam Duffy

Posts: 168
Nickname: adamduffy
Registered: Feb, 2003

Re: exception handling Posted: Dec 5, 2003 3:47 AM
Reply to this message Reply
See here

http://java.sun.com/docs/books/tutorial/essential/exceptions/

Adam

Flat View: This topic has 2 replies on 1 page
Topic: Garbage collector question Previous Topic   Next Topic Topic: Screen resolution

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use