File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Statement not reachable?? 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 "Statement not reachable??" Watch "Statement not reachable??" New topic
Author

Statement not reachable??

srikanth reddy
Ranch Hand

Joined: Jul 28, 2005
Posts: 252


here why there is no error that statement is not reachable ...since the control returns out of main method??? c is not printed ..so why there isn't any error??


Thanks & Regards<br /> <br />-Srikanth
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Try to put the return statement before the try catch block.. then you 'll get the error. When there is an exception ( checked or Unchecked ) thrown inside the try block then catch gets executed after that the S.O.P line will be rechable
[ October 14, 2005: Message edited by: Srinivasa Raghavan ]

Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Liang Tong
Greenhorn

Joined: Oct 14, 2005
Posts: 2
"return" means "terminate"
if there's no finally block in the structure "try-catch-finally"
the "return" in try block means "this method is over"
 
 
subject: Statement not reachable??
 
Similar Threads
unreachable statement again
statement not reachable??
return type
Unreachable code?
why there is no unreachable compile error ?