aspose file tools*
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
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: 6657
    
    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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reachable statement
 
Similar Threads
Difference between the way of throwing exception.
Statement not reachable
Unreachable statement
Re checking the connection
Not reachable code