wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Statement not reachable" Watch "Statement not reachable" New topic

Statement not reachable

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Case #1

Case #2

Case #4

Case #5

Case #6

I have doubt specially regarding Case #1 and Case #6

Why is in first case, the statement is not reachable even if the if statement is certainly to execute because of if(true), I compare this with
while(true){}; because any statement that comes after that, is not reachable.

Can anybody please give me idea of that!

[ April 30, 2007: Message edited by: Chandra Bhatt ]

Nik Arora
Ranch Hand

Joined: Apr 26, 2007
Posts: 652
Hi Chandra,
Hey whats your doubt exactly
Abdul Mohsin
Ranch Hand

Joined: Apr 26, 2007
Posts: 111

Good question,
I am expecting answer from you only !!!

Regards, Abdul Mohsin
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707

I have found very good explanation to all the given issues, in JLS

Very down to this html page
I agree. Here's the link: http://aspose.com/file-tools
subject: Statement not reachable
Similar Threads
how the compiler decides about the unreachable stmt
plz exaplin me this Prog
SCJP 6, 15.04.2010 12:30 CET
Unreachable statement
Doubt on return type.