• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding reachable and unreachable statements.

 
Karthikeyan Ganesh Sarma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic