The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


i have another question

Posted by yinbin on July 19, 2001 at 9:54 AM

> You must be inheriting all your three exceptions classes from Exception class. So, in catch just pass an argument of type Exception and not of one of three types you have created and this will catch any of your three types of exceptions.

> try {
> }
> catch ( Exception e ) {
> // If you want to take action based on which type
> // of exception ( out of 3) was caught then check the
> // type of argument e here
> }
but the question means that you must catch three Exceptions once in a single catch block,but how?

  • oh,i know yinbin July 19, 2001 at 9:57 AM (0)

Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us