This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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 Head First Android 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: 1710
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: 1710

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:
subject: Statement not reachable
It's not a secret anymore!