in the above example first its returning value 1. after that as finally executes always its returning 3 and u r getting the output 3 remove finally u will get output 1.
i hope so u got it..
Harish<br />SCJP 1.4 (85%)
Veer Batra
Ranch Hand
Joined: Mar 12, 2001
Posts: 35
posted
0
It works for me and output is 3.
Karu Raj
Ranch Hand
Joined: Aug 31, 2005
Posts: 479
posted
0
hi all I am using jdk 1.4
Raghusham Sankargal
Ranch Hand
Joined: Oct 10, 2005
Posts: 59
posted
0
Hello, Its a warning not an error. Did you try java <class-name>. Tell me if you get the error. I don't think you should get.
Raghusham Sankargal
Vijayagopalan Raveendran
Ranch Hand
Joined: Apr 18, 2005
Posts: 41
posted
0
finally block is executed irrespective of whether exception is thrown or not.