This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes reachable statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "reachable statement" Watch "reachable statement" New topic
Author

reachable statement

Stary Kapec
Ranch Hand

Joined: Dec 04, 2005
Posts: 81


Hi, why there is no compile error at line 1?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

That wont qualify for an unreachable statement because the finally block always runs after the try block completes. Lets say for some reason your infinite loop fails after sometime because you did something like this...



The compiler thinks since the try might fail for some reason i am gonna let this guy get away with this.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Charith Fernando
Ranch Hand

Joined: Sep 12, 2005
Posts: 67
hi

it doesnt give a compilation error saying that its not reachable because it is something to do with the logic of the program. compiler wont check whether a code is reachable by checking the logic of the program...


Charith I Fernando<br />SCJP5, SCWCD, SCBCD, BSc(Hons) IS<br />+94 773 263 222 (mobile)
 
Don't get me started about those stupid light bulbs.
 
subject: reachable statement