2009/6/4 Rajkumar Goel:
> Hi all
> this is the method:
> def Hello()=try{1}finally{2}
>
> when I call this statement I get the output as 1;
>
> Now when I change to statement to
> def Hello()=try{return 1} finally{return 2}
>
> I get the out put as 2
>
> what might be reason?
> Thanks,
> Rajkumar Goel
>
>
Hello Rajkumar,
If a finally clause includes an "explicit" return statement, or throws an
exception, that return value or exception will overrule any previous one
that originated in the try block or one of its catch clauses...
Hope this helps :)
--
Cheers,
Pratik K Anand
[Non-text portions of this message have been removed]
------------------------------------
IRC #twincling on irc.freenode.net
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/twincling/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/twincling/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/