not so smart guy still curious to learn new stuff every now and then
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Sample14.java:17: warning: finally clause cannot complete normally
}
^
1 warning
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Munish Gulati<br />SCJP 1.4<br />Albert Einstein: There are only two ways to live your life. One is as though nothing is a miracle. The other is as though everything is a miracle.
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
If a try block has a return statement and a finally block is added with a
return statement, the first return statement is ignored/unused.
A finally clause is always entered with a reason. That reason may be that the try code finished normally, that it executed a control flow statement such as return, or that an exception was thrown in code executed in the try block. The reason is remembered when the finally clause exits by falling out the bottom. However, if the finally block creates its own reason to leave by executing a control flow statement(such as break or return) or by throwing exception, that reason supersedes the original one, and the reason is forgotten.
Don't get me started about those stupid light bulbs. |