"Richard Vagner":
Welcome to JavaRanch. Please take a look at our
display name policy and
edit your display name to something not obviously fictitious. Hint: Giuseppe Verdee would not work either.
As for your comments: well I wouldn't call the K&B statement an error exactly, it's just a bit incomplete. The return -1 statement is read and executed, in the sense that the return value of -1 has been set - but the return isn't
fully completed until the finally has also been processed. The way I think of it,
part of the return -1 has been executed, but not all of it. Consider this alternative:
Here the return value is 0, not -1. That's because the return 0 is executed
after the return -1. Think of it this way - when a return statement is executed, the JVM saves the return value (as the value that the JVM
plans to return, if it doesn't receive other instructions in a finally block). A return statement
always is subject to being countermanded later in a finally block. If the finally block doesn't have another return statement, or throw some other exception, then after the finally block executes, the JVM will return whatever value it saved back when the original return was first executed.