Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4432337

Catching multiple exceptions simultaneously

XMLWordPrintable

    • rc
    • generic, x86
    • generic, windows_xp
    • Verified



      Name: ssT124754 Date: 03/30/2001


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-001, native threads, symcjit)

      If I need to catch three exceptions, say, NamingException, CreateException and
      RemoteException (all of which are descendants of java.lang.Exception) and if I
      need to take the same action for them I should not be required to catch them
      one after the other. Your compiler should allow me to do something like the
      following:

      Exception exc;
      try
      {
         //bunch of stuff
      }
      catch (NamingException, RemoteException, CreateException exc)
      {
          exc.getMessage ();
      }
      (Review ID: 119838)
      ======================================================================

            abuckley Alex Buckley
            ssultanasunw Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: