Article View: borland.public.jbuilder.java.language
Article #17276Re: quiz
From: John P. McGrath
Date: Tue, 24 Nov 1998 00:00
Date: Tue, 24 Nov 1998 00:00
25 lines
1227 bytes
1227 bytes
Nikolaos Giannopoulos <nikolaos@solmar.ca> wrote: > -10 : : > The finally statement is ALWAYS executed even if there isn't > an exception. As a matter of fact you can have a try-finally > block WITHOUT a catch block - and it is quite useful. The > idea for finally is to do any housekeeping exception or no > exception. You are correct that the "finally" clause is always executed. But the value returned from the method is the value specified in the return statement. _result is not changed to -10 until after the return statement is executed. Since the value of _result is 1010 at the time that the return statement is executed, the method returns 1010. -- Regards, John P. McGrath <mcgrath@enter.net> <jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.10c4586987f53509989735@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<73b97j$5q012@forums.borland.com> <3659C0FF.7B05F52C@solmar.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,f51b0f21d8f8b176 X-Google-Attributes: gidf74b3,public From: mcgrath@enter.net (John P. McGrath) Subject: Re: quiz Date: 1998/11/24 Message-ID: <MPG.10c4586987f53509989735@forums.inprise.com> X-Deja-AN: 415124577 References: <73b97j$5q012@forums.borland.com> <3659C0FF.7B05F52C@solmar.ca> Organization: Software Consulting Services Newsgroups: borland.public.jbuilder.java.language