Does it make sense to do "try-finally" without "catch"?

Posted by glanden on Stack Overflow See other posts from Stack Overflow or by glanden
Published on 2010-04-10T18:37:36Z Indexed on 2010/04/10 18:43 UTC
Read the original article Hit count: 224

Filed under:
|

I saw some code like this:

    try
    {
        db.store(mydata);
    }
    finally
    {
        db.cleanup();
    }

I thought try is supposed to have a catch?

Why does this code do it this way?

© Stack Overflow or respective owner

Related posts about java

Related posts about exception