That's easy. You are not supposed to return a value in the finally block since it overwrites any previous return values and also any exceptions that are thrown. Return statements in a finally block are a big NO-NO.
Stephen CortexConnect.com On Thu, Sep 29, 2011 at 3:36 PM, gk <[email protected]> wrote: > What is the output of the following method? > > public boolean whatDoesItDo() > { > try > { > if(true) > { > throw new IllegalStateException(); > } > return true; > } > finally > { > if(true) > { > return false; > } > } > } > > Have a nice time figuring it out ;-) > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
