| Author |
unreachable statement
|
sun par
Ranch Hand
Joined: Oct 03, 2002
Posts: 257
|
|
gives unreachable statement at 6. is it bcos line 7 is not reached? Thanks
|
Sunita<br />SCJP 1.4
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
The syntax for a while statement is: while(boolean_condition) statement; If, as in your example, boolean_condition is false, then statement is unreachable. Beacause a block which is { statement; ... } IS a statement the message that line 6 is unreachable is correct. Sort of... -Barry
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
sun par
Ranch Hand
Joined: Oct 03, 2002
Posts: 257
|
|
|
Thanks Barry
|
 |
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
|
|
|
Also check out JLS 14.20 Unreachable Statements
|
SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
|
 |
 |
|
|
subject: unreachable statement
|
|
|