Results 1 to 2 of 2
  1. #1
    AlmostAGuru is offline Member
    Join Date
    Aug 2009
    Posts
    5
    Rep Power
    0

    Default Will finally get executed...

    try
    {

    //Do something that throws an Exception


    }
    catch(Exception ex)
    {

    throw AnApplicationException();

    }
    finally
    {
    try { close a connection } catch {};

    }

    Will the finally block be executed if the catch block throws another application exception. We have a similiar situation in one of our applications - wherein I do not think the connection is being closed by finally. :rolleyes:

    Thankx in advance....

  2. #2
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default

    i think so... why not set up a simple application and run it?

Similar Threads

  1. Finally done :D
    By Shadaw in forum Java Applets
    Replies: 3
    Last Post: 12-24-2008, 04:45 AM
  2. How to use Finally
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:40 PM
  3. Try---finally
    By javarishi in forum New To Java
    Replies: 14
    Last Post: 04-09-2008, 10:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •