aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes regarding reachable and unreachable statements. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "regarding reachable and unreachable statements." Watch "regarding reachable and unreachable statements." New topic
Author

regarding reachable and unreachable statements.

Karthikeyan Ganesh Sarma
Greenhorn

Joined: Mar 08, 2001
Posts: 7
Hello everybody,
I've got a simple doubt regarding reachable and unreachable statements. can anyone explain me the difference between the two as i am pretty confused with the logic. For ex if i execute the following code....

if i execute the above code i get a comple error at line 2 saying the line is unreachable...but if interchange both line 1 and 2 it works fine. can anyone throw light on this.Thanks in advance.
Rajeshwari Natarajan
Ranch Hand

Joined: Mar 05, 2003
Posts: 67
At line 1 in the catch bloack u have a return statement, which effectively trasnfers control out of the method so line 2 is not reachable.


regards<br />Rajeshwari. N
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding reachable and unreachable statements.
 
Similar Threads
unreachable code in 'finally'
finally in try/catch Mock exam
Exception ??
exception
Traps to be aware of in any SCJP test !!!!! :)